Remove race condition when aborting while connecting/reconnecting.
This commit is contained in:
parent
fb3e6b7e35
commit
c2ae1ee891
@ -420,6 +420,8 @@ class XMLStream(object):
|
|||||||
:param reattempt: Flag indicating if the socket should reconnect
|
:param reattempt: Flag indicating if the socket should reconnect
|
||||||
after disconnections.
|
after disconnections.
|
||||||
"""
|
"""
|
||||||
|
self.stop.clear()
|
||||||
|
|
||||||
if host and port:
|
if host and port:
|
||||||
self.address = (host, int(port))
|
self.address = (host, int(port))
|
||||||
try:
|
try:
|
||||||
@ -452,7 +454,6 @@ class XMLStream(object):
|
|||||||
|
|
||||||
def _connect(self, reattempt=True):
|
def _connect(self, reattempt=True):
|
||||||
self.scheduler.remove('Session timeout check')
|
self.scheduler.remove('Session timeout check')
|
||||||
self.stop.clear()
|
|
||||||
|
|
||||||
if self.reconnect_delay is None or not reattempt:
|
if self.reconnect_delay is None or not reattempt:
|
||||||
delay = 1.0
|
delay = 1.0
|
||||||
|
Loading…
Reference in New Issue
Block a user