aspose file tools*
The moose likes Java in General and the fly likes class Socket 's big problem Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Java in General
Bookmark "class Socket Watch "class Socket New topic
Author

class Socket 's big problem

Sun LiWei
Ranch Hand

Joined: Aug 10, 2002
Posts: 49
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.
raimondas zemaitis
Ranch Hand

Joined: Feb 23, 2001
Posts: 104
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.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: class Socket 's big problem