So you are not talking about ports, but sockets. And it seems like you need to change either the TCP keepalive or socket timeout values. This should help you: http://tldp.org/HOWTO/html_single/TCP-Keepalive-HOWTO/
Fri Aug 1 03:56:38 UTC 2008
D Steward <dsteward at internode.on.net>
So you are not talking about ports, but sockets. And it seems like you need to change either the TCP keepalive or socket timeout values. This should help you: http://tldp.org/HOWTO/html_single/TCP-Keepalive-HOWTO/