Reset the connect future after a disconnect

This commit is contained in:
mathieui 2015-07-28 23:54:11 +02:00 committed by Florent Le Coz
parent e75a160d52
commit f9c7fa92ea

View file

@ -435,9 +435,11 @@ class XMLStream(asyncio.BaseProtocol):
Forcibly close the connection
"""
if self.transport:
self.transport.close()
self.transport.abort()
self.event("killed")
self.disconnected.set_result(True)
self.disconnected = asyncio.Future()
def reconnect(self, wait=2.0):
"""Calls disconnect(), and once we are disconnected (after the timeout, or