mirror of
https://github.com/LonamiWebs/Telethon.git
synced 2024-11-11 03:56:36 +03:00
Fix automatic reconnect (e.g. on bad auth key)
This took more time than it should have to debug.
This commit is contained in:
parent
bc1fd9039d
commit
3fd7c33127
|
@ -14,6 +14,10 @@ class ConnectionTcpFull(Connection):
|
||||||
super().__init__(ip, port, loop=loop)
|
super().__init__(ip, port, loop=loop)
|
||||||
self._send_counter = 0
|
self._send_counter = 0
|
||||||
|
|
||||||
|
async def connect(self):
|
||||||
|
await super().connect()
|
||||||
|
self._send_counter = 0 # Important or Telegram won't reply
|
||||||
|
|
||||||
def _send(self, data):
|
def _send(self, data):
|
||||||
# https://core.telegram.org/mtproto#tcp-transport
|
# https://core.telegram.org/mtproto#tcp-transport
|
||||||
# total length, sequence number, packet and checksum (CRC32)
|
# total length, sequence number, packet and checksum (CRC32)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user