From 52a468d9fd3476c4f00ccf339c65c364fe3a27f1 Mon Sep 17 00:00:00 2001 From: shortcutme Date: Tue, 3 Oct 2017 14:34:21 +0200 Subject: [PATCH] Allow 10 second for reponse --- src/Connection/ConnectionServer.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/Connection/ConnectionServer.py b/src/Connection/ConnectionServer.py index 7e14df32..f3a97ca5 100644 --- a/src/Connection/ConnectionServer.py +++ b/src/Connection/ConnectionServer.py @@ -200,17 +200,17 @@ class ConnectionServer: # Incomplete data with more than 10 sec idle connection.close("[Cleanup] Connection buff stalled") - elif idle > 10 and connection.waiting_requests and time.time() - connection.last_send_time > 20: + elif idle > 10 and connection.protocol == "?": # No connection after 10 sec + connection.close( + "[Cleanup] Connect timeout: %.3fs" % idle + ) + + elif idle > 10 and connection.waiting_requests and time.time() - connection.last_send_time > 10: # Sent command and no response in 10 sec connection.close( "[Cleanup] Command %s timeout: %.3fs" % (connection.last_cmd, time.time() - connection.last_send_time) ) - elif idle > 30 and connection.protocol == "?": # No connection after 30 sec - connection.close( - "[Cleanup] Connect timeout: %.3fs" % idle - ) - elif idle < 60 and connection.bad_actions > 40: connection.close( "[Cleanup] Too many bad actions: %s" % connection.bad_actions