Re: socket connection not being reset correctly



On Fri, 22 Jul 2005 09:05:57 +0100, Allan Bruce wrote:
> I have found that netstat reckons the connections are still up, so
> is it my JVM thats causing the problem? Or can I setup the sockets
> in a way for them to not display this behaviour?

Unplugging a cable should not normally cause a socket connection to
terminate, and this has absolutely nothing to do with Java. TCP was
designed to be resilient and will handle intermittent network
interruptions. Consider also how your computer should detect an
unplugged cable somewhere else along your communication route, not
directly attached to either of your computers.

If your application really needs to detect this situation, you should
add something like a heartbeat message to your protocol. If you don't
get a response within a certain timeout, assume the network is down.

/gordon

--
[ do not email me copies of your followups ]
g o r d o n + n e w s @ b a l d e r 1 3 . s e
.