-
Notifications
You must be signed in to change notification settings - Fork 17
Realtime messaging not working properly #3
Comments
I tried using my android device (receiver), along with an iphone as sender. I have the same issue (not on the first message that I'm sending, but on another one right after). I managed to capture the traffic from my iPhone, but I couldn't identify the TCP traffic from my application. Is gpg using SSL or something for p2p communication? |
I managed to produce this critical issue using the ButtonClicker source code. Add this method to ButtonClickerEngine.mm:
Then edit GameModel.mm and change the startGame method so it looks like that
Then run the game on 2 devices (I've used an iPhone and an iPad), and you'll often have out of order packets in the log like this log (as well as Errors during send):
Please advice since this is a critical issue preventing any real usage of your Realtime APIs. |
Hi, have you managed to reproduce this bug using the modified ButtonClicker sample? |
I tried the sendReliableMessageBlocking method of the SDK, using a specific thread to send the data, and sync my main thread with the sending thread (so it continues only when the sendReliableMessageBlocking method returns), and it's working a little better. Please advice? |
Still no answer (at least an acknowledgment of the issue being reproduced) after more than a month. |
Hi,
I'm writing a multiplayer game which uses gpg RealtimeMultiplayer API.
I'm facing multiple issues with it:
1/ Reliable messages are not arriving in order
2/ I often get an error during the send, but the message still arrives
1/ Here is the log of what I'm sending (burst send)
cocos2d: sending chunk of size 4 to p_CPDEjqzHuPOlYRAB
cocos2d: sending chunk of size 1400 to p_CPDEjqzHuPOlYRAB
cocos2d: sending chunk of size 1400 to p_CPDEjqzHuPOlYRAB
cocos2d: sending chunk of size 1400 to p_CPDEjqzHuPOlYRAB
cocos2d: sending chunk of size 1400 to p_CPDEjqzHuPOlYRAB
cocos2d: sending chunk of size 1400 to p_CPDEjqzHuPOlYRAB
cocos2d: sending chunk of size 826 to p_CPDEjqzHuPOlYRAB
cocos2d: sending chunk of size 4 to p_CPDEjqzHuPOlYRAB
cocos2d: sending chunk of size 5 to p_CPDEjqzHuPOlYRAB
The message is printed right before calling RealTimeMultiplayer().SendReliableMessage().
And here is the log on the receiver side:
cocos2d: OnDataReceived from p_CNnB1Na874r21gEQAQ (Reliable): 4 bytes
cocos2d: OnDataReceived from p_CNnB1Na874r21gEQAQ (Reliable): 1400 bytes
cocos2d: OnDataReceived from p_CNnB1Na874r21gEQAQ (Reliable): 1400 bytes
cocos2d: OnDataReceived from p_CNnB1Na874r21gEQAQ (Reliable): 1400 bytes
cocos2d: OnDataReceived from p_CNnB1Na874r21gEQAQ (Reliable): 1400 bytes
cocos2d: OnDataReceived from p_CNnB1Na874r21gEQAQ (Reliable): 1400 bytes
cocos2d: OnDataReceived from p_CNnB1Na874r21gEQAQ (Reliable): 4 bytes
cocos2d: OnDataReceived from p_CNnB1Na874r21gEQAQ (Reliable): 826 bytes
cocos2d: OnDataReceived from p_CNnB1Na874r21gEQAQ (Reliable): 5 bytes
The message is printed at the begining of the OnDataReceived() method.
How is that possible, the documentation specifies that the Reliable data are sent and received in order (should be if it's using TCP). Is there a bug in the gpg sdk which calls the callback not in order (another thread might be receiving the data, and not calling the callback correctly?).
Another question, who is responsible for flow control? Is it the SendReliableMessage() API that bufferize my data if it cannot immediatly send it, or should I do it myself (if so, how do I know if the receiver if "full"?)
2/ I check the RealTimeMultiplayer().SendReliableMessage() status from the lambda passed to the function, and in my previous example, I got in the log for the very first chunk I sent:
cocos2d: Message sending status: FAIL (-3)
-3 being ERROR_NOT_AUTHORIZED
But the chunk arrived to the receiver.
Why did I get this error (only for the first message, but I sometimes have this error multiple time in a row)? Should I ignore send errors (not very safe, I want my game to stop if a player is not receiving the data)?
I did all my tests using an iPhone6 and an iPad4, using the same build.
I didn't even try using an iOS device with an Android one... yet.
Every run, I have some messages out of order and/or send errors. In fact on my 50+ runs, I never got the full message in order on the receiver.
Thanks!
The text was updated successfully, but these errors were encountered: