Subject: Re: Detecting broken connection

Re: Detecting broken connection

From: Jose Baars <>
Date: Wed, 14 Jul 2010 20:16:46 +0200

What also helps or might even be necessary, depending on your operating
system etc.,
is turning on SO_KEEPALIVE with set socketopt on your socket.
If you set this, you get an error from your socket, especially when doing a
if the connection is broken, if you don't set it, you may not.

If you're lucky, your system admin turned this on as a system-wide default,
if you're not lucky, or on Linux (where you can't turn this on as a system
wide default
the last time I looked), you might not be able to detect a broken

The SSH keepalive options might mitigate this, but I did not try, so no

Received on 2010-07-14