I’m working with TCP IP Socket.
Is THIS the simplest way to detect that a client socket connection is broken?
I would be surprised if there is no Java API that detects a dead client and throws an exception. This should be possible at least when the server tries to send a packet to the client from the lack of an ACK response.
TCP protocol does not support any fast means of detecting a broken connection.
This question (and all of it’s answers) explain the problem in full: Does a TCP socket connection have a "keep alive"?
So basically yes, that is the simplest way. You need to implement ping-pong packets (aka HearBeat packet) in your application protocol to verify the broken connection properly.