I faced similar problem. In my case client must send data periodically. I hope you have same requirement. Then I set SO_TIMEOUT socket.setSoTimeout(1000 * 60 * 5);
which is throw java.net.SocketTimeoutException
when specified time is expired. Then I can detect dead client easily.