12

I'm working with GameKit.framework and I'm trying to create a reliable communication between two iPhones.

I'm sending packages with the GKMatchSendDataReliable mode.

The documentation says:

GKMatchSendDataReliable

The data is sent continuously until it is successfully received by the intended recipients or the connection times out. Reliable transmissions are delivered in the order they were sent. Use this when you need to guarantee delivery.

Available in iOS 4.1 and later. Declared in GKMatch.h.

I have experienced some problems on a bad WiFi connection. The GameKit does not declare the connection lost, but some packages never arrive.

Can I count on a 100% reliable communication when using GKMatchSendDataReliable or is Apple just using fancy names for something they didn't implement?

ThomasCle
  • 6,792
  • 7
  • 41
  • 81
  • I have never used the reliable mode, but i experienced many problems when testing GC apps on the simulator. Make sure you test your app on two devices. – Adam Aug 29 '12 at 14:35

2 Answers2

1

My users also complain that some data may be accidentally lost during the game. I wrote a test app and figured out that GKMatchSendDataReliable is not really reliable. On weak internet connection (e.g. EDGE) some packets are regularly lost without any error from 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 purpose: RoUTP. It saves all sent messages until acknowledgement for each received, resends lost and buffers received messages in case of broken sequence. In my tests combination "RoUTP + GKMatchSendDataUnreliable" works even beter than "RoUTP + GKMatchSendDataReliable" (and of course better than pure GKMatchSendDataReliable which is not really reliable).

Yan
  • 886
  • 7
  • 13
  • 2
    I have collected evidence that agrees with you. I have to admit I am astonished by this, not to mention very disappointed in Apple. I mean seriously, their reliable connection is just blatantly unreliable? I have to add a transport layer on top of a game layer that sits on top of multiple transport layers? What next, shall we start writing some hardware flow control in the app? FFS. – theLastNightTrain Aug 18 '14 at 21:03
0

It nearly 100% reliable but maybe not what you need sometimes… For example you dropped out of network all the stuff that you send via GKMatchSendDataReliable will be sent in the order you've send them. This is brilliant for turn-based games for example, but if fast reaction is necessary a dropout of the network would not just forget the missed packages he would get all the now late packages till he gets to realtime again.

The case GKMatchSendDataReliable doesn't send the data is a connection time out. I think this would be also the case when you close the app

lukaswelte
  • 2,951
  • 1
  • 23
  • 45