Why am I getting dropped packets when using GKMatchSendDataReliable?
I have an iOS multiplayer game and I am sending data using GKMatchSendDataReliable
. However, sometimes a data packet is lost. I have checked on submit and I am not getting an error. I just don't get it on admission. It is intermittent and I have NSLogs right at the beginning of my getter method so I always know when I get a message.
Is it GKMatchSendDataReliable
100% reliable? It seems like waste should be setting up my own robust data submission routines.
This seems to only happen when one device is on the Verizon LTE network. I have not tried any other cellular network. When using only Wi-Fi
, not necessarily the same wi-fi, it works great.
source to share
My users also complain that some data can be accidentally lost while playing. I wrote a test application and realized that it was GKMatchSendDataReliable
not very reliable. On a weak internet connection (eg EDGE), some packages are regularly lost without errors in the Game Center API.
So the only option is to add an extra transport layer for truly reliable delivery.
I wrote a simple lib for this: RoUTP . It retains all sent messages until an acknowledgment is received for each received, sent lost message, and received message buffers in case of out-of-sequence. In my tests, the combination "RoUTP + GKMatchSendDataUnreliable" is even faster than "RoUTP + GKMatchSendDataReliable" (and certainly better than pure GKMatchSendDataReliable, which is not very reliable).
source to share