Hi, I have a SSLSocket pool and I need to check if the socket connection is sane before borrowing the object.
The isConnected, isInputShutdown and isOutputShutdown are useless because they don't check if both sides are connected and if I try to write or read from the socket I might get a SocketException.
Here is my code for testing a connection:
if(sslSocket.isConnected() &&
!sslSocket.isInputShutdown() &&
!sslSocket.isOutputShutdown()){
valid = true;
}
This code doesn't work, as explained above.
So, what is the best way to check if a SSLSocket (or a regular Socket) is sane?
Thank you.