B
Bryan
Hello all,
Can anyone tell me how I can tell if a socket has been disconnected on
the client end? I've got a class that creates a SocketServer to listen
on a port and when an connection is initiated it hands the socket off
to a thread. I want to be able to tell when a socket gets disconnected
by the client so I can have a graceful end to the connection's thread.
Right now when a client disconnects I get all kinds of exceptions from
my methods that are reading data from the socket's input stream. I
would like to use InputStream's available() method along with some way
of knowing if the socket still exists before passing the input stream
to my read methods. I tried using Socket's isConnected() method but it
still returns true even after the client disconnects.
Thanks in advance!!!
Can anyone tell me how I can tell if a socket has been disconnected on
the client end? I've got a class that creates a SocketServer to listen
on a port and when an connection is initiated it hands the socket off
to a thread. I want to be able to tell when a socket gets disconnected
by the client so I can have a graceful end to the connection's thread.
Right now when a client disconnects I get all kinds of exceptions from
my methods that are reading data from the socket's input stream. I
would like to use InputStream's available() method along with some way
of knowing if the socket still exists before passing the input stream
to my read methods. I tried using Socket's isConnected() method but it
still returns true even after the client disconnects.
Thanks in advance!!!