XMPPFramework icon indicating copy to clipboard operation
XMPPFramework copied to clipboard

XMPP Reconnect

Open swathi-gali opened this issue 14 years ago • 10 comments

Xmpp gets disconnected when internet connection is lost. Is there any way to reconnect to xmpp automatically after the internet connection is established even if the app is in the background?

swathi-gali avatar Jul 03 '12 12:07 swathi-gali

I would like to know the same I'm guessing ud have to monitor network status every so many minutes

eni9889 avatar Jul 10 '12 09:07 eni9889

Am also facing the same issue. The app wont reconnect if the app is in background. However as soon as the app comes to the foreground, it gets reconnected. (Am using the XMPP Reconnect Module).

If the internet connection is persistent, the works in background for hours without any issue.

basants avatar Dec 26 '12 13:12 basants

Does anyone have a solution?

jaap-dekkinga avatar Nov 05 '13 14:11 jaap-dekkinga

Any Solution ??

ravikanthatstoryboard avatar Mar 09 '17 09:03 ravikanthatstoryboard

I am using Reachability for reconnect

x3mall1986 avatar Mar 09 '17 11:03 x3mall1986

@x3mall1986 i am using Reachability , Once Internet is connect i am trying to reconnect with below code

rebindAuthentication = XMPPRebindAuthentication(stream: sender, sessionID: xmppProcess?.savedSessionID!, sessionJID: xmppProcess?.savedSessionJID)

ravikanthatstoryboard avatar Mar 09 '17 11:03 ravikanthatstoryboard

@ravikanthatstoryboard I am using [self.xmppStream connectWithTimeout:XMPPStreamTimeoutNone error:&error]

for connect and reconect

x3mall1986 avatar Mar 09 '17 12:03 x3mall1986

thank a lot .. @x3mall1986 reconnecting working now .....

ravikanthatstoryboard avatar Mar 10 '17 04:03 ravikanthatstoryboard

@x3mall1986 xmppStream is frequently disconnecting ?

By using this i am recconnecting again [self.xmppStream connectWithTimeout:XMPPStreamTimeoutNone error:&error]

is there any solution for that ?

ravikanthatstoryboard avatar Mar 10 '17 05:03 ravikanthatstoryboard

@ravikanthatstoryboard xmppStream is disconnected only when the connection to the Internet is lost. Read the error from delegates:

- (void)xmppStream:(XMPPStream *)sender didReceiveError:(id)error - (void)xmppStreamDidDisconnect:(XMPPStream *)sender withError:(NSError *)error

x3mall1986 avatar Mar 10 '17 08:03 x3mall1986