On Wed, Sep 25, 2013 at 8:00 PM, Niall Douglas <s_sourceforge@nedprod.com> wrote:
On 25 Sep 2013 at 17:21, Chris Verges wrote:

> Do you happen to know if writing a zero-length message would be enough
> to trigger the socket layers to reset without forcing data across the
> physical layer?  (I'm in the middle of coding it up as a test, but
> figured I'd ask just in case you happened to know.)

Much better to turn on TCP keepalive (it's one of the socket
options). Then you'll learn when the transport has gone away.

Only after the keepalive timer has fired.  I believe that on current linux you won't have to endure the FIN_WAIT_1 and FIN_WAIT_2 if the interface itself is gone.

But, if you're hoping for a quick notification that the interface is gone, just for keepalive won't do it for you.


--
Chris Cleeland