That is just the problem, if a client for whatever reason disconnects (closes the socket with the server) instead of closing the connection properly, the server still assumes the connection is active. And this is what I want to detect so I can stop the forked process.