From owner-freebsd-net Tue May 8 12:23:18 2001 Delivered-To: freebsd-net@freebsd.org Received: from khavrinen.lcs.mit.edu (khavrinen.lcs.mit.edu [18.24.4.193]) by hub.freebsd.org (Postfix) with ESMTP id 5900E37B423 for ; Tue, 8 May 2001 12:23:16 -0700 (PDT) (envelope-from wollman@khavrinen.lcs.mit.edu) Received: (from wollman@localhost) by khavrinen.lcs.mit.edu (8.9.3/8.9.3) id PAA64300; Tue, 8 May 2001 15:23:03 -0400 (EDT) (envelope-from wollman) Date: Tue, 8 May 2001 15:23:03 -0400 (EDT) From: Garrett Wollman Message-Id: <200105081923.PAA64300@khavrinen.lcs.mit.edu> To: "Jonathan Graehl" Cc: Subject: Do I need to close after shutdown if I don't want to leak descriptors? (making sure TCP retransmits all my data) In-Reply-To: <000001c0d6d5$87607e80$6dfeac40@straylight.com> References: <000001c0d6d5$87607e80$6dfeac40@straylight.com> Sender: owner-freebsd-net@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.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