From 888e286a09647ed70abb6b69dd8114268a7712ac Mon Sep 17 00:00:00 2001 From: Lance Stout Date: Mon, 7 Nov 2011 01:13:34 -0800 Subject: Continue trying to reconnect, even if the attempt fails. The transition from disconnected to connected states must be done in a loop in case the transition fails, not just once and hope it worked. --- sleekxmpp/xmlstream/xmlstream.py | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/sleekxmpp/xmlstream/xmlstream.py b/sleekxmpp/xmlstream/xmlstream.py index 8abbb3a1..c9b85bd8 100644 --- a/sleekxmpp/xmlstream/xmlstream.py +++ b/sleekxmpp/xmlstream/xmlstream.py @@ -530,12 +530,8 @@ class XMLStream(object): """ Reset the stream's state and reconnect to the server. """ - log.debug("reconnecting...") - self.state.transition('connected', 'disconnected', wait=2.0, - func=self._disconnect, args=(True,)) - log.debug("connecting...") - return self.state.transition('disconnected', 'connected', - wait=2.0, func=self._connect) + self.disconnect() + self.connect() def set_socket(self, socket, ignore=False): """ -- cgit v1.2.3