File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

class Socket 's big problem

 
Sun LiWei
Ranch Hand
Posts: 49
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 104
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic