expose is_connecting state based on connection attempt future
This commit is contained in:
parent
a16e2a0f6c
commit
ab9040c30e
1 changed files with 4 additions and 0 deletions
|
@ -380,6 +380,7 @@ class XMLStream(asyncio.BaseProtocol):
|
|||
"ssl_object",
|
||||
default=self.transport.get_extra_info("socket")
|
||||
)
|
||||
self._current_connection_attempt = None
|
||||
self.init_parser()
|
||||
self.send_raw(self.stream_header)
|
||||
self.dns_answers = None
|
||||
|
@ -438,6 +439,9 @@ class XMLStream(asyncio.BaseProtocol):
|
|||
self.send(error)
|
||||
self.disconnect()
|
||||
|
||||
def is_connecting(self):
|
||||
return self._current_connection_attempt is not None
|
||||
|
||||
def is_connected(self):
|
||||
return self.transport is not None
|
||||
|
||||
|
|
Loading…
Reference in a new issue