Subject: Re: Dumb/silly network programming question
To: Paul Goyette <>
From: David Laight <>
List: current-users
Date: 12/09/2003 08:01:36
On Sat, Dec 06, 2003 at 07:30:45AM -0800, Paul Goyette wrote:
> How does one tell if a TCP socket has been disconnected without trying
> to write to the socket?

You don't, it isn't part of the spec :-)

If KEEPALIVES are enabled on the socket (and I don't think they are
by default) then the first keepalive message is sent after 2 hours
of idle time.

I actually think IP was designed to allow you to reboot a system
that was acting as a gateway without connections through it being lost.


David Laight: