On Thu, 8 Jul 2004, Shachar Shemesh wrote:

> There are two ways of closing a TCP socket. One is to use "close", and
> the other is to use "shutdown". The later allows half-closed sockets
> (i.e. - one side is closed, the other still open), which is a bonus.
> However, the info page for shutdown states that closing the write part
> (i.e. - saying you won't send any more data) will discard any unsent
> data. This is a problem when using asynchronous mode. The only
> workaround that pops to mind is to use fsync, which is blocking and thus
> unsuitable.

i'm not sure which info page you're looking at, but as far as i know,
'shutdown' will not discar data currently found in the socket's buffer.
it'll emit the EOF only after it send all pending data.

on redhat 7.3, as well as on fedora core 2, the man pages state nothing
about such data throwing. you can also look at the source code of apache
(for example) to see how they use shutdown (on some platforms...).

-- 
guy

"For world domination - press 1,
 or dial 0, and please hold, for the creator." -- nob o. dy

=================================================================
To unsubscribe, send mail to [EMAIL PROTECTED] with
the word "unsubscribe" in the message body, e.g., run the command
echo unsubscribe | mail [EMAIL PROTECTED]

Reply via email to