From owner-freebsd-net Mon May 7 14:22:19 2001 Delivered-To: freebsd-net@freebsd.org Received: from molly.straylight.com (molly.straylight.com [204.69.232.69]) by hub.freebsd.org (Postfix) with ESMTP id 5ED9B37B423 for ; Mon, 7 May 2001 14:22:17 -0700 (PDT) (envelope-from jonathan@graehl.org) Received: from case (root@localhost [127.0.0.1]) by molly.straylight.com (8.11.0/8.10.0) with ESMTP id f47LLmH16629; Mon, 7 May 2001 14:21:48 -0700 From: "Jonathan Graehl" To: "'Alfred Perlstein'" Cc: Subject: RE: Do I need to close after shutdown if I don't want to leak descriptors? (making sure TCP retransmits all my data) Date: Mon, 7 May 2001 14:22:13 -0700 Message-ID: <000201c0d73b$cae4abc0$6dfeac40@straylight.com> MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook, Build 10.0.2605 X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4522.1200 Importance: Normal In-Reply-To: <20010507022726.P18676@fw.wintelcom.net> Sender: owner-freebsd-net@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org Thanks for the suggestion - it does fit the bill, although I have to getsockopt(SO_SNDBUF on a per-socket basis (I'm using the kqueue NOTE_LOWAT, which doesn't trigger if I supply a very large number - the exact SO_SNDBUF needs to be used). I'd honestly just prefer to have the kernel close the socket for me, though ;) It is certain that a close() after shutdown() is needed to avoid leaking descriptors, then? > 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 > To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-net" in the body of the message