[Spread-users] detecting network outages

Matt Garman matthew.garman at gmail.com
Fri Aug 14 09:18:32 EDT 2009


On Wed, Jul 8, 2009 at 12:57 PM, Daniel F. Savarese<dfs at savarese.org> wrote:
> If you're going to connect to a remote daemon, the only way I know of
> for the client to detect a loss of connection to the Spread daemon
> is via the usual TCP/IP client-server programming techniques.  This
> would involve setting the SO_KEEPALIVE socket option and then using
> ...

Thank you, Daniel, and everyone else for your help and suggestions for
dealing with this issue.  I went ahead and used TCP Keepalive in my
program, as you suggested.  Ultimately, it was pretty straightforward,
and (at least in testing) seems to do exactly what we wanted.

For posterity, the TCP Keepalive HOWTO was very helpful in getting
this working in my code:
    http://tldp.org/HOWTO/TCP-Keepalive-HOWTO/

Also for posterity: a relevant question on stackoverflow, "Detecting
TCP Client Disconnect":
    http://stackoverflow.com/questions/283375/detecting-tcp-client-disconnect

Thanks again everyone,
Matt




More information about the Spread-users mailing list