L
layman
Hello group,
I am using a ServerSocket to accept TCP connections, so once a
connection is established a Socket reference is returned. The Socket
class provides isClosed() and isConnected() method, however it seems
that both of the two methods always returns (false, true)
correspondingly, even if the client already disconnected. But when the
server attempts to write sth. to the socket's output stream, A
"connection reset" exception is thrown, which I DO NOT consider it as a
good way for detecting connection broken or not.
Any other solutions?
Thank you in advance!
layman
I am using a ServerSocket to accept TCP connections, so once a
connection is established a Socket reference is returned. The Socket
class provides isClosed() and isConnected() method, however it seems
that both of the two methods always returns (false, true)
correspondingly, even if the client already disconnected. But when the
server attempts to write sth. to the socket's output stream, A
"connection reset" exception is thrown, which I DO NOT consider it as a
good way for detecting connection broken or not.
Any other solutions?
Thank you in advance!
layman