David Malone wrote: > > A shutdown guarantees that the data is transferred from the socket > > buf to the TCP buf. The real question here is how you get to the > > state you claim is happening: the so isdisconnected() should stall > > the calling process until the data has drained, if this is the case, > > or it should never get called until the buffer is empty. > > I think your fears about data being lost here may be unfounded. > The description of soisdisconnected() says: > > ... soisdisconnected() is called when the connection to the > peer is totally severed. > > This seems to mean that that either the connection has timed out > or has been aborted. I think it should be safe to drop any data > which is waiting to be sent if connection is actually severed. > > I've included a list of the places where soisdisconnected is called > from, and they all seem pretty final.
I think you are complaining about the default for the keepalive socket option. I think you will get the behaviour ytou desire without hacking up the code, just by: sysctl -w net.inet.tcp.always_keepalive=0 PS: You still didn't answer the question; yes, it's called when the connection is "totally severed". But when is the connection ever "totally severed"? PPS: Ask yourself: how is it that it's *EVER* possible for the function soisdisconnected() to be called without the socket buffer having been emptied *FIRST*. -- Terry To Unsubscribe: send mail to [EMAIL PROTECTED] with "unsubscribe freebsd-net" in the body of the message