mirror of
https://github.com/correl/SleekXMPP.git
synced 2024-11-27 19:19:54 +00:00
Add reattempt to ClientXMPP.connect
This commit is contained in:
parent
2908751020
commit
13a2f719f4
1 changed files with 6 additions and 3 deletions
|
@ -139,7 +139,7 @@ class ClientXMPP(BaseXMPP):
|
||||||
log.debug("Session start has taken more than 15 seconds")
|
log.debug("Session start has taken more than 15 seconds")
|
||||||
self.disconnect(reconnect=self.auto_reconnect)
|
self.disconnect(reconnect=self.auto_reconnect)
|
||||||
|
|
||||||
def connect(self, address=tuple()):
|
def connect(self, address=tuple(), reattempt=True):
|
||||||
"""
|
"""
|
||||||
Connect to the XMPP server.
|
Connect to the XMPP server.
|
||||||
|
|
||||||
|
@ -149,6 +149,8 @@ class ClientXMPP(BaseXMPP):
|
||||||
|
|
||||||
Arguments:
|
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()
|
self.session_started_event.clear()
|
||||||
if not address or len(address) < 2:
|
if not address or len(address) < 2:
|
||||||
|
@ -190,7 +192,8 @@ class ClientXMPP(BaseXMPP):
|
||||||
# If all else fails, use the server from the JID.
|
# If all else fails, use the server from the JID.
|
||||||
address = (self.boundjid.host, 5222)
|
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):
|
def register_feature(self, mask, pointer, breaker=False):
|
||||||
"""
|
"""
|
||||||
|
|
Loading…
Reference in a new issue