aspose file tools*
The moose likes Sockets and Internet Protocols and the fly likes how to check whether a connection is exited? 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 » Sockets and Internet Protocols
Bookmark "how to check whether a connection is exited? " Watch "how to check whether a connection is exited? " New topic
Author

how to check whether a connection is exited?

kahkean chor
Ranch Hand

Joined: Jan 26, 2013
Posts: 56
how to check whether a connection is exited? (socket)
William Brogden
Author and all-around good cowpoke
Rancher

Joined: Mar 22, 2000
Posts: 12682
    
    5
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

Java Resources at www.wbrogden.com
 
Don't get me started about those stupid light bulbs.
 
subject: how to check whether a connection is exited?
 
Similar Threads
how to maintain database using Threads
HTTPS Cipher Threshold
exit of an object
problem in connectivity through datasource to oracle database
nullpointer