Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

how to check whether a connection is exited?

 
kahkean chor
Ranch Hand
Posts: 67
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
how to check whether a connection is exited? (socket)
 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13062
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Assuming you mean when the other side of your connection has closed the socket.

For one thing, you will get an IOException when you try to write to it or read from it.

In general, see the java.net.Socket JavaDocs for methods to check state of a socket.

Bill
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic