From 4ac69aacda17e722cee8fccf561aab5c8a425893 Mon Sep 17 00:00:00 2001 From: YuriCat Date: Thu, 12 Oct 2023 05:11:50 +0900 Subject: [PATCH] fix: disconnect after socket.timeout --- handyrl/connection.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/handyrl/connection.py b/handyrl/connection.py index 8b01d555..51e6271e 100755 --- a/handyrl/connection.py +++ b/handyrl/connection.py @@ -201,6 +201,8 @@ def _send_thread(self): conn, send_data = self.output_queue.get() try: conn.send(send_data) + except TimeoutError: + self.disconnect(conn) except ConnectionResetError: self.disconnect(conn) except BrokenPipeError: @@ -212,6 +214,9 @@ def _recv_thread(self): for conn in conns: try: recv_data = conn.recv() + except TimeoutError: + self.disconnect(conn) + continue except ConnectionResetError: self.disconnect(conn) continue