1833252 Members
3127 Online
110051 Solutions
New Discussion

Recycle a Socket

 
SOLVED
Go to solution
Simpson
Occasional Advisor

Recycle a Socket

Is there anyway to restart/recycle a single socket connection? i know it will eventually time out but i have been asked to provide a solution to a socket that is stuck without a reboot.

Thanks
2 REPLIES 2
Laurent Menase
Honored Contributor
Solution

Re: Recycle a Socket

Hi
What is the state of your socket?

check with netstat -an or ndd -get /dev/tcp tcp_status

else you have a ndd tcp_discon_by_addr


Else we have a lot of different timeouts.
the most usefull is usually keepalive. you configure SO_KEEPALIVE on your socket, then it will send a probe to the peer. In case of no response after the usual timeout( tcp_ip_abort_interval ndd param) your connection is reset.
By default keepalive interval is 2hours, which is very long, you can lower it with ndd parameter tcp_keepalive_interval.

You must then configure tcp_keepalive_interval and tcp_ip_abort_interval to values which matches with your requirements.

If you lower tcp_ip_abort_interval, you need also to be sure tcp_notify_interval stay tcp_ip_abort_interval.


Simpson
Occasional Advisor

Re: Recycle a Socket

Thanks, I was able to accomplish what I needed by temporarily lowering the keepalive to ensure any ports atht needed clearing/recycling happened. thanks