This is the mail archive of the
glibc-bugs@sourceware.org
mailing list for the glibc project.
[Bug manual/1983] New: socket(s, 1) said to discard sent data
- From: "ceder at ingate dot com" <sourceware-bugzilla at sourceware dot org>
- To: glibc-bugs at sources dot redhat dot com
- Date: 6 Dec 2005 11:54:44 -0000
- Subject: [Bug manual/1983] New: socket(s, 1) said to discard sent data
- Reply-to: sourceware-bugzilla at sourceware dot org
The Closing a Socket node says that shutdown works like this:
> `1'
> Stop trying to transmit data from this socket. Discard any
> data waiting to be sent. Stop looking for acknowledgement of
> data already sent; don't retransmit it if it is lost.
I have looked at shutdown(3n) in Solaris 10, and in the Single Unix
Specification, and they both say nothing about discarding data waiting
to be sent. Does shutdown() really do that? If it does, I think it
is a bug. To the best of my understanding, the reason why you would
use shutdown(s,1) on a TCP socket is to send a FIN packet to the remote
side, but you typically still want all the data to arrive there. (If any
data is discarded, I would naively assume that it would follow the policy
set up by SO_LINGER.)
My (rather unfounded) hypothesis is that the glibc manual is wrong in
this section.
(Page 11 of the document "An Introduction to OpenSSL Programming (Part I)",
which can be found at http://www.rtfm.com/openssl-examples/, shows why it
can be useful to force a FIN packet while still not wanting to discard
any sent data (the close_notify in this case).)
--
Summary: socket(s, 1) said to discard sent data
Product: glibc
Version: 2.3.5
Status: NEW
Severity: normal
Priority: P2
Component: manual
AssignedTo: roland at gnu dot org
ReportedBy: ceder at ingate dot com
CC: glibc-bugs at sources dot redhat dot com
http://sourceware.org/bugzilla/show_bug.cgi?id=1983
------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.