summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGeorg Lukas <georg@op-co.de>2020-04-04 13:12:59 +0200
committerGeorg Lukas <georg@op-co.de>2020-04-04 13:16:31 +0200
commitab9040c30ecfadfcd30acf9980946aa74c097fe4 (patch)
treebe6f7b519145624b207006866675affe99a29220
parenta16e2a0f6c6dcd3bde55fce1771b7bb5c22cf38c (diff)
downloadslixmpp-ab9040c30ecfadfcd30acf9980946aa74c097fe4.tar.gz
slixmpp-ab9040c30ecfadfcd30acf9980946aa74c097fe4.tar.bz2
slixmpp-ab9040c30ecfadfcd30acf9980946aa74c097fe4.tar.xz
slixmpp-ab9040c30ecfadfcd30acf9980946aa74c097fe4.zip
expose is_connecting state based on connection attempt future
-rw-r--r--slixmpp/xmlstream/xmlstream.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/slixmpp/xmlstream/xmlstream.py b/slixmpp/xmlstream/xmlstream.py
index cbb7950a..594acbdd 100644
--- a/slixmpp/xmlstream/xmlstream.py
+++ b/slixmpp/xmlstream/xmlstream.py
@@ -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