Determining Link Failures Networks tend to fail. That's a fact of life. The 'reliable' TCP protocol does not let you know when there is a network failure - it just sees this as lost packets, and retransmits them time and again. Solution: define an application-level 'keep alive' protocol - your server should ping your clients after X time of inactivity, and mark them as dead if they fail to answer after Y time. Notes: different networks fail differently. Make your 'keep alive' timeout parameters tunable by config files, to allow adapting them to different environments.