Date: Mon, 7 May 2001 02:27:26 -0700 From: Alfred Perlstein <bright@wintelcom.net> To: Jonathan Graehl <jonathan@graehl.org> 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: <20010507022726.P18676@fw.wintelcom.net> In-Reply-To: <000001c0d6d5$87607e80$6dfeac40@straylight.com>; from jonathan@graehl.org on Mon, May 07, 2001 at 02:10:14AM -0700 References: <000001c0d6d5$87607e80$6dfeac40@straylight.com>
next in thread | previous in thread | raw e-mail | index | archive | help
* Jonathan Graehl <jonathan@graehl.org> [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 - [alfred@freebsd.org] 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 majordomo@FreeBSD.org with "unsubscribe freebsd-net" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20010507022726.P18676>