netdev
[Top] [All Lists]

Re: shutdown() and SHUT_RD on TCP sockets - broken?

To: jmorris@xxxxxxxxxxxxxxxx (James Morris)
Subject: Re: shutdown() and SHUT_RD on TCP sockets - broken?
From: kuznet@xxxxxxxxxxxxx
Date: Tue, 8 Jul 2003 21:03:07 +0400 (MSD)
Cc: mtk-lists@xxxxxxx, netdev@xxxxxxxxxxx
In-reply-to: <Mutt.LNX.4.44.0307090227050.9091-100000@xxxxxxxxxxxxxxxxxxxxxxxxxx> from "James Morris" at 09, 2003 02:28:12
Sender: netdev-bounce@xxxxxxxxxxx
Hello!

> blocks.  I see that this also occurs on FreeBSD 4.8, Tru64 5.1B,
> HP/UX 11 and Solaris 8.  Have I misunderstood Stevens,

Most likely, it is that rare case when Stevens forgot to check the statement.

From viewpoint of TCP the behaviour described in Stevens' book
is highly unnatural. SHUT_RD on TCP does not make any sense.


> described here.  But, why do things happen in this way on Linux?

Actually, you could check one more thing. What does happen after freebsd 4.8
returns 0 on read()? Does it open window eventually?

As you checked, all the stacks ignore SHUT_RD, when receiving data
and queue it anyway. And when read()ing Linux and, apparently Solaris,
prefer to return this data.

Alexey

<Prev in Thread] Current Thread [Next in Thread>