I am working on an iOS application that allows users to share PDF files with other devices locally. When the application starts the device, it becomes a client that searches for servers that transfer files. When the client sees the server, he adds an icon to his tab and adds an entry to the table.
The problem that I encountered is that GKSession only allows one line to be transmitted before the connection is established. Partner display name. What I would like to convey is the file name, the number of pages, and possibly a thumbnail.
The only way I can think now, to achieve this behavior is to automatically connect the client and servers, exchange information about the files, and then automatically disconnect them. This might work if only one or two files currently exist, there will probably be problems with streams / synchronization when many different devices are broadcast.
For example, 7 files may be available. Thus, the client will have to connect to them one by one in order to receive information about all the files. This will probably take a lot of time, and the user may have already decided that they want to download file 1. By clicking "file 1", you need to establish a connection and start the transfer. This may not happen instantly if the client is busy retrieving information about other available files.
I also read some problems connecting to the server shortly after it was disconnected .. ( what does GKSession not connect with every attempt? ).
So, I think it comes down to simple questions. Does anyone have any ideas how I can let the client get additional information about the server except peerID and peerName?
source share