mirror of
https://github.com/LonamiWebs/Telethon.git
synced 2025-08-08 21:10:29 +00:00
Update tcp_transport.py
Counter before send, in case of fail send, will not result error 500 random_id_duplicate
This commit is contained in:
@@ -27,9 +27,9 @@ class TcpTransport:
|
|||||||
|
|
||||||
crc = crc32(writer.get_bytes())
|
crc = crc32(writer.get_bytes())
|
||||||
writer.write_int(crc, signed=False)
|
writer.write_int(crc, signed=False)
|
||||||
|
|
||||||
self.tcp_client.write(writer.get_bytes())
|
|
||||||
self.send_counter += 1
|
self.send_counter += 1
|
||||||
|
self.tcp_client.write(writer.get_bytes())
|
||||||
|
|
||||||
def receive(self, timeout=timedelta(seconds=5)):
|
def receive(self, timeout=timedelta(seconds=5)):
|
||||||
"""Receives a TCP message (tuple(sequence number, body)) from the connected peer.
|
"""Receives a TCP message (tuple(sequence number, body)) from the connected peer.
|
||||||
|
Reference in New Issue
Block a user