Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 7 May 2001 14:22:13 -0700
From:      "Jonathan Graehl" <jonathan@graehl.org>
To:        "'Alfred Perlstein'" <bright@wintelcom.net>
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:  <000201c0d73b$cae4abc0$6dfeac40@straylight.com>
In-Reply-To: <20010507022726.P18676@fw.wintelcom.net>

next in thread | previous in thread | raw e-mail | index | archive | help
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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?000201c0d73b$cae4abc0$6dfeac40>