We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent b9c50b0 commit 2ba921cCopy full SHA for 2ba921c
1 file changed
pyrogram/connection/transport/tcp/tcp.py
@@ -19,6 +19,7 @@
19
import ipaddress
20
import logging
21
import socket
22
+import time
23
24
try:
25
import socks
@@ -72,6 +73,9 @@ def close(self):
72
73
except OSError:
74
pass
75
finally:
76
+ # A tiny sleep placed here helps avoiding .recv(n) hanging until the timeout.
77
+ # This is a workaround that seems to fix the occasional delayed stop of a client.
78
+ time.sleep(0.001)
79
super().close()
80
81
def recvall(self, length: int) -> bytes or None:
0 commit comments