maxpowel / jQuery-XMPP-plugin

Javascript library for the XMMP protocol
http://plugins.jquery.com/project/xmpp-lib
163 stars 50 forks source link

Reconnect issue #12

Closed bluemoz closed 12 years ago

bluemoz commented 12 years ago

Testing Jquery-XMPP on a mobile device and simulating a online->offline->online state, the client disconnects without catching the disconnect event and doesn't try to reconnect automatically. There's a solution for that?

Thanks a lot Davide

maxpowel commented 12 years ago

Hi! How do you simulate these actions? Its looks like the disconnect event is only catched when a manual disconnect is done. Im working on catching the disconnect event when for some reason the connection is closed

bluemoz commented 12 years ago

Thanks for you answer. I'm testing in on a iphone using aereo mode. On a PC you could try to disconnect and reconnect the lan. How could be done an interval check to catch the network down event?

maxpowel commented 12 years ago

I think that the event onDisconnect should be triggered but it is not done yet. I'm working on this

maxpowel commented 12 years ago

Hi! Please check this https://github.com/maxpowel/jQuery-XMPP-plugin/issues/8 If you want to reconnect, you should call connect method inside onDisconnect event or onError event.

This solution is right for you?