mirror of
https://github.com/LonamiWebs/Telethon.git
synced 2025-08-08 04:52:30 +00:00
Handle initial connection if network is down correctly
This commit is contained in:
@@ -44,9 +44,14 @@ class Connection(abc.ABC):
|
||||
Disconnects from the server.
|
||||
"""
|
||||
self._disconnected.set()
|
||||
self._send_task.cancel()
|
||||
self._recv_task.cancel()
|
||||
self._writer.close()
|
||||
if self._send_task:
|
||||
self._send_task.cancel()
|
||||
|
||||
if self._recv_task:
|
||||
self._recv_task.cancel()
|
||||
|
||||
if self._writer:
|
||||
self._writer.close()
|
||||
|
||||
@property
|
||||
def disconnected(self):
|
||||
|
Reference in New Issue
Block a user