Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Lost messages over XMPP on device disconnected

Tags:

android

xmpp

I'm trying to develop a turn base game over XMPP. ( The only solution I found for multiplatform game ). I can send messages without problems. If the other user isn't online, the server (OpenFire) save it for later deliver.

The problem cames when a device change the network ( change from 3g to WiFi, change 3g IP... ) or the device lost the network ( turn off 3g, wifi or lost connection ). The server thinks that the device is online and send the message but it ( obviusly ) never arrive, so packet is lost.

I know one solution. Implement ACK over my game protocol, but I don't like this idea to much. Do you have any other suggestion? I think this is a server problem. Do you know another server witch implements TCP or ACK?

Thank you!!

EDIT: I do that: Connect device to server. I turn down the 3G and WiFi connectivity to the device. Android and the server still thinking that the connection is alive.

http://issues.igniterealtime.org/browse/SMACK-331

PD: I ask to openfeint for they multiplayer api, but they didn't asnwer me...

like image 847
Daniel Argüelles Avatar asked Mar 13 '12 18:03

Daniel Argüelles


1 Answers

Although BOSH will likely work in this case, another option is XEP-0198: Stream Management. This will allow you to have all of the performance of a fully-connected socket, along with quick reconnects, positive acking, and queuing while un-acked or disconnected in both directions.

like image 189
Joe Hildebrand Avatar answered Oct 16 '22 03:10

Joe Hildebrand