Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 7 May 2001 02:27:26 -0700
From:      Alfred Perlstein <>
To:        Jonathan Graehl <>
Cc:        freebsd-net@FreeBSD.ORG
Subject:   Re: Do I need to close after shutdown if I don't want to leak descriptors? (making sure TCP retransmits all my data)
Message-ID:  <>
In-Reply-To: <000001c0d6d5$87607e80$>; from on Mon, May 07, 2001 at 02:10:14AM -0700
References:  <000001c0d6d5$87607e80$>

Next in thread | Previous in thread | Raw E-Mail | Index | Archive | Help
* Jonathan Graehl <> [010507 02:10] wrote:
> Scenario: I accept a (TCP) connection, write some data, close the
> connection.
> Problem: close() does not perform an orderly shutdown, does not resend
> unacknowledged data - responds with RST to data/acks sent to me
> Non-solution: SO_LINGER, makes close into a blocking call in order to
> get orderly shutdown

Here's a trick that may work.

use setsockopt to set SO_SNDLOWAT == SO_SNDBUF, when you get a writeable
event back you know the socket is clear.  this is good because you
should be able to go back to using poll/kevent to monitor them.

-Alfred Perlstein - []
Instead of asking why a piece of software is using "1970s technology,"
start asking why software is ignoring 30 years of accumulated wisdom.

To Unsubscribe: send mail to
with "unsubscribe freebsd-net" in the body of the message

Want to link to this message? Use this URL: <>