FULL PRODUCT VERSION :
ADDITIONAL OS VERSION INFORMATION :
n/a - documentation issue
A DESCRIPTION OF THE PROBLEM :
People new to sockets often get this wrong..
bool Socket.isConnected()
what the javadoc should say:
Initially this method returns false. After a connection is established, this method method returns true. It will never change back to false for any reason (like the connection failing).
bool Socket.isClosed()
what the javadoc should say:
Initially this method returns false. After Socket.close() is invoked this method returns true. It will not return true for any other reason (like the connection being closed by the remote end).
REPRODUCIBILITY :
This bug can be reproduced always.
ADDITIONAL OS VERSION INFORMATION :
n/a - documentation issue
A DESCRIPTION OF THE PROBLEM :
People new to sockets often get this wrong..
bool Socket.isConnected()
what the javadoc should say:
Initially this method returns false. After a connection is established, this method method returns true. It will never change back to false for any reason (like the connection failing).
bool Socket.isClosed()
what the javadoc should say:
Initially this method returns false. After Socket.close() is invoked this method returns true. It will not return true for any other reason (like the connection being closed by the remote end).
REPRODUCIBILITY :
This bug can be reproduced always.
- duplicates
-
JDK-4672570 Socket can be connected and closed at the same time
-
- Closed
-