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!

socket close client-server connection

843790Oct 3 2009 — edited Oct 4 2009
hi,

im wondering what is the best way to close the connection between my server and client. i use socket and serversocket for the connection

now i want my server to close the connection. i simply call socket.close() and close the outputstream. however the client still thinks of an open socket and still continues writing and reading from the stream.

i know i could send some kind of status-code to the client but isnt there any way to check directly from the clientside if the server is still listening?
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Nov 1 2009
Added on Oct 3 2009
4 comments
294 views