Re: POLLHUP not being raised 2.3.99-pre4-2

From: David S. Miller (davem@redhat.com)
Date: Fri Mar 31 2000 - 19:48:42 EST

  • Next message: Paul Barton-Davis: "Re: designing fast, streaming disk i/o with mmap: help wanted"

       Date: Fri, 31 Mar 2000 16:30:57 -0800
       From: Jordan Mendelson <jordy@napster.com>

       For some reason, POLLHUP is not being raised on poll() of a
       properly closed socket under 2.3.99-pre4-2. It repeatedly returns
       only POLLIN and read() returns 0.

       This behavior did not seem to happen under 2.2.x.

       Debian unstable w/ gcc 2.95.2 (debian 20000313 build).

    Are you performing a full close, or just a half-close. If a half
    close, POLLHUP should not be raised if either write or the read side
    can still move data. POLLHUP is only to be sent when both the send
    and receive side of the socket is closed. This is necessary because
    POLLHUP's semantics were not designed with a half close in mind.

    See the commentary in net/ipv4/tcp.c:tcp_poll(), this behavior
    match the behavior of many other OS's, including Solaris HPUX and
    others.

    Later,
    David S. Miller
    davem@redhat.com

    -
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to majordomo@vger.rutgers.edu
    Please read the FAQ at http://www.tux.org/lkml/



    This archive was generated by hypermail 2b29 : Fri Mar 31 2000 - 19:57:52 EST