diff --git a/handyrl/connection.py b/handyrl/connection.py index 8b01d55..51e6271 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