LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Networking (https://www.linuxquestions.org/questions/linux-networking-3/)
-   -   KEEPALIVE does not detect disconnection at the expected time (https://www.linuxquestions.org/questions/linux-networking-3/keepalive-does-not-detect-disconnection-at-the-expected-time-290847/)

emonette 02-16-2005 04:02 AM

KEEPALIVE does not detect disconnection at the expected time
 
Hello,

I hope you could help me out with my problem with keepalive.

I have programs in C that use sockets. In the code, I enabled the KEEPALIVE by setsockopt. Actually, I think the enabling worked because whenever the client connects and I issue the "netstat -top" command, I could see that the port used in the connection is in "keepalive" state. It is supposed to detect disconnection after 2.5 to 3 mins because I changed the following variables in /proc/sys/net/ipv4 :
tcp_keepalive_time = 30 seconds
tcp_keepalive_probes = 2
tcp_keepalive_intvl = 75 (default setting)

The problem is that it does not detect disconnection at the expected time. The moment I disconnected the LAN cable, the state of the port connection is changed to "on" and it is still ESTABLISHED, I checked it using the "netstat -top" command. Its not supposed to be like this right?. the connection is should be disconnected by this time but it only detects disconnection after 19-22 minutes.
That seems to be a pretty long delay right? :)

I would really appreciate any help.

Thank you very much :)
Monette


All times are GMT -5. The time now is 09:43 AM.