summaryrefslogtreecommitdiff
path: root/sleekxmpp/clientxmpp.py
diff options
context:
space:
mode:
authorLance Stout <lancestout@gmail.com>2011-01-07 16:41:31 -0500
committerLance Stout <lancestout@gmail.com>2011-01-07 16:41:31 -0500
commit13a2f719f4e31e48df05a5df8fa470d704e15528 (patch)
treec36c598761c5c1175e0d224e0860133e5b32a8e6 /sleekxmpp/clientxmpp.py
parent2908751020b61da5466ff15644628e29bd5bbd3a (diff)
downloadslixmpp-13a2f719f4e31e48df05a5df8fa470d704e15528.tar.gz
slixmpp-13a2f719f4e31e48df05a5df8fa470d704e15528.tar.bz2
slixmpp-13a2f719f4e31e48df05a5df8fa470d704e15528.tar.xz
slixmpp-13a2f719f4e31e48df05a5df8fa470d704e15528.zip
Add reattempt to ClientXMPP.connect
Diffstat (limited to 'sleekxmpp/clientxmpp.py')
-rw-r--r--sleekxmpp/clientxmpp.py9
1 files changed, 6 insertions, 3 deletions
diff --git a/sleekxmpp/clientxmpp.py b/sleekxmpp/clientxmpp.py
index 32795e4b..734c9a14 100644
--- a/sleekxmpp/clientxmpp.py
+++ b/sleekxmpp/clientxmpp.py
@@ -139,7 +139,7 @@ class ClientXMPP(BaseXMPP):
log.debug("Session start has taken more than 15 seconds")
self.disconnect(reconnect=self.auto_reconnect)
- def connect(self, address=tuple()):
+ def connect(self, address=tuple(), reattempt=True):
"""
Connect to the XMPP server.
@@ -148,7 +148,9 @@ class ClientXMPP(BaseXMPP):
will be used.
Arguments:
- address -- A tuple containing the server's host and port.
+ address -- A tuple containing the server's host and port.
+ reattempt -- If True, reattempt the connection if an
+ error occurs.
"""
self.session_started_event.clear()
if not address or len(address) < 2:
@@ -190,7 +192,8 @@ class ClientXMPP(BaseXMPP):
# If all else fails, use the server from the JID.
address = (self.boundjid.host, 5222)
- return XMLStream.connect(self, address[0], address[1], use_tls=True)
+ return XMLStream.connect(self, address[0], address[1],
+ use_tls=True, reattempt=reattempt)
def register_feature(self, mask, pointer, breaker=False):
"""