diff options
author | lovetox <philipp@hoerist.com> | 2020-04-10 23:22:29 +0300 |
---|---|---|
committer | lovetox <philipp@hoerist.com> | 2020-04-10 23:22:29 +0300 |
commit | d8b35aca9095e7a3d6b43c0991e982baf9530259 (patch) | |
tree | c9b9560e11907294a0babb7431ecb4a643a5f5a6 /nbxmpp | |
parent | ec3c756b9c7657dee552ef196aa492df3db57fdd (diff) |
Client: Remove ping timer when peer closes connection
Diffstat (limited to 'nbxmpp')
-rw-r--r-- | nbxmpp/client.py | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/nbxmpp/client.py b/nbxmpp/client.py index bcb159d..2c7eb72 100644 --- a/nbxmpp/client.py +++ b/nbxmpp/client.py @@ -417,6 +417,8 @@ class Client(Observable): def _on_disconnected(self, _connection, _signal_name): self.state = StreamState.DISCONNECTED + self._remove_ping_timer() + self._dispatcher.remove_ping_callback(self._ping_id) self._reset_stream() self.notify('disconnected') @@ -449,6 +451,7 @@ class Client(Observable): if not self._stream_close_initiated: self.state = StreamState.DISCONNECTING self._remove_ping_timer() + self._dispatcher.remove_ping_callback(self._ping_id) self._smacks.close_session() self._end_stream() self._con.shutdown_output() |