I have a c, c++ program. which is using TCP
sockets.
when i make my interface down using ifdown
. network interface goes down.
but when i see the netstat
there it still shows the connection state is established
between client and server.
I want to close my socket immediately as interface is down. I know if i will reduce keep-alive time
it may help.
But i want to know if there is any other better way to do this.
Does any signal
gets generated when interface is down?
OR is there anything else which can tell my application that interface is down so that i can close my socket?
netstat -o output:-
> tcp 0 0 172.16.12.51:9999 172.16.12.51:38117 ESTABLISHED 3130/./DiaServertD off (0.00/0/0)
> tcp 0 0 172.16.12.51:38117 172.16.12.51:9999 ESTABLISHED 3177/./sampleGxClie off (0.00/0/0)