I am developing a TCP echo server using python and the socket library.
I'd like to have a timeout configured for each incoming connection. So to drop and close them if there is inactivity for a
This is achieve with the specific setting:
At the same time I would like to maintain active the connection that use keepalive method. So, if a keepalive probe packet is received by the server from a given client I'd like to avoid the use of timeout to close this particular client/connection.
Problem clarification >> I'd like to have the server dropping every connection after 3 minutes of inactivity. This is achieved with the
settimeout(SOCK_TIMEOUT) function. The main problem is that the current configuration and implementation of the TCP socket is not considering the keep-alive probe as "activity" thus, the connection is closed even if the probes are acknowledged.
Q1 >> Does this make sense?
I'd say this should be feasible. However, the socket server is unable to handle, as I desired, the keepalive probe. Because, even if those are acknowledged by the server, ACK is returned to each probe, the connection is closed at timeout.
Q2 >> Should I change the timeout implementation?