From owner-freebsd-net Mon Apr 29 3:55:23 2002 Delivered-To: freebsd-net@freebsd.org Received: from albatross.prod.itd.earthlink.net (albatross.mail.pas.earthlink.net [207.217.120.120]) by hub.freebsd.org (Postfix) with ESMTP id 42B2737B404 for ; Mon, 29 Apr 2002 03:55:21 -0700 (PDT) Received: from pool0031.cvx40-bradley.dialup.earthlink.net ([216.244.42.31] helo=mindspring.com) by albatross.prod.itd.earthlink.net with esmtp (Exim 3.33 #2) id 1728oP-0005HS-00; Mon, 29 Apr 2002 03:55:18 -0700 Message-ID: <3CCD2679.B5D5A709@mindspring.com> Date: Mon, 29 Apr 2002 03:54:49 -0700 From: Terry Lambert X-Mailer: Mozilla 4.7 [en]C-CCK-MCD {Sony} (Win98; U) X-Accept-Language: en MIME-Version: 1.0 To: David Malone Cc: net@freebsd.org Subject: Re: soisdisconnected tweak. References: <200204291006.aa93819@salmon.maths.tcd.ie> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Sender: owner-freebsd-net@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org 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 majordomo@FreeBSD.org with "unsubscribe freebsd-net" in the body of the message