in jdk 1.4,the isClosed() and isConnected() methods of Sokcet class does't detect whether the tcp connection is closed by remote host. Only if the client socket invoke the s.close(),the two methods will show right result. It seems there's no way to know whether the tcp connection is closed by remote host.
posted 13 years ago
same situation in RMI (if remote server crashes, any attempt to invoke it hangs forever). Try to use pinging with timeout if that's what you want.