From c83daf87717d469f5ce920b8d764a7895f51f46e Mon Sep 17 00:00:00 2001 From: Dan <14043624+delivrance@users.noreply.github.com> Date: Sun, 17 Dec 2017 13:50:43 +0100 Subject: [PATCH] Correctly shutdown the socket --- pyrogram/connection/transport/tcp/tcp.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pyrogram/connection/transport/tcp/tcp.py b/pyrogram/connection/transport/tcp/tcp.py index 17fdcba6..a8fca46c 100644 --- a/pyrogram/connection/transport/tcp/tcp.py +++ b/pyrogram/connection/transport/tcp/tcp.py @@ -32,6 +32,10 @@ class TCP(socket.socket): def recv(self, *args): pass + def close(self): + self.shutdown(socket.SHUT_RDWR) + super().close() + def recvall(self, length: int) -> bytes or None: data = b""