Skip to Main Content

Java APIs

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Wrong return from java.net.Socket.isConnected()

843790Sep 12 2006 — edited Sep 12 2006
Hi all,
I use javax.net.ssl package to transport some bytes over tcp. That works fine. But i m checking the connection before sending something from the server to the client and vice versa and that causes some problems. When i check the Socket-Connection before connecting it, i got:
isConnected() -> false
isBound() -> false
isClosed() ->true

after connecting i got:

isConnected() ->true
isBound() ->true
isClosed() ->false

when the opposit side closes the connection I still get:

isConnected() -> true
isBound() ->true
isClosed->false

but when i try to access the connection i get:
"Connection has been shutdown: javax.net.ssl.SSLException: java.net.SocketException: Connection reset" .

Why stays isConnected() true even if there is no more connection? Why stays isClosed() false even when there is no more open connection? Is this the correct behauviour or should I get something else?

Greetings

Jugan
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Oct 10 2006
Added on Sep 12 2006
4 comments
229 views