From 2344c185fedeb0ba2f6f96ab74d184f6dd849c87 Mon Sep 17 00:00:00 2001 From: Nova Cat Date: Mon, 9 Dec 2024 17:02:20 -0800 Subject: [PATCH] shutdown when ping timeout --- server.py | 1 + 1 file changed, 1 insertion(+) diff --git a/server.py b/server.py index c4fd39b..23641f6 100644 --- a/server.py +++ b/server.py @@ -41,6 +41,7 @@ def pinger(nick, connection): property_list[nick]["ping_pending"] = True elif property_list[nick]["ping_pending"] and ((time.time() - property_list[nick]["last_ping"]) > 120): property_list[nick]["cause"] = "Ping timeout: 120 seconds" + connection.shutdown(socket.SHUT_WR) connection.close() break def session(connection, client):