wood burning stoves 2.0*
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


Win a copy of Java 8 in Action this week in the Java 8 forum!
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
 
Similar Threads
Socket appears connected even after closing the socket
Problems in isBound() and isClosed() methods in the Socket class
Unable to connect to server inside swing app
Question about ServerSocket port number and Socket port number