Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 8 May 2001 15:23:03 -0400 (EDT)
From:      Garrett Wollman <wollman@khavrinen.lcs.mit.edu>
To:        "Jonathan Graehl" <jonathan@graehl.org>
Cc:        <freebsd-net@FreeBSD.ORG>
Subject:   Do I need to close after shutdown if I don't want to leak descriptors? (making sure TCP retransmits all my data)
Message-ID:  <200105081923.PAA64300@khavrinen.lcs.mit.edu>
In-Reply-To: <000001c0d6d5$87607e80$6dfeac40@straylight.com>
References:  <000001c0d6d5$87607e80$6dfeac40@straylight.com>

next in thread | previous in thread | raw e-mail | index | archive | help
<<On Mon, 7 May 2001 02:10:14 -0700, "Jonathan Graehl" <jonathan@graehl.org> said:

> Problem: close() does not perform an orderly shutdown, does not resend
> unacknowledged data - responds with RST to data/acks sent to me

I suggest that this is a bug.

> Incomplete solution: shutdown(SHUT_RDWR), but then what?  Will the OS
> close the fd for me once the other end acknowledges, or better yet,
> closes its end as well, or do I need to close the fd?

No, you still have to close.

> (selecting for readable is not a solution; if they have
> sent me data I am uninterested in reading, I will select readable)

selecting for an exception *should* do what you want, but doesn't
(this is also a bug).

> Obviously, if shutdown fails (it shouldn't, I die on failure), you would
> need to close to avoid descriptor leakage.  But do I need to babysit the
> descriptor after I have no more interest in it?

Yes.  shutdown != close.

-GAWollman


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?200105081923.PAA64300>