Catching a client disconnection...

webmasterbeta

New Member
I'm currently making a multi-threaded server, and i'm having trouble, whileinside a created thread to a specific client, in detect when the client disconnects.For example:I forced socket.close() and then asked for the client inetaddress (socket.getInetAddress())and it's replyed the correct client address, my question is:If the socket is already closed why is not retrivied something like nullor -1, so that i could detect the disconnected client?Besides sending a message to the client and then try to cath Exception incase the socket's already closed, is there any other way to do this?Yours,Vicent
 
Top