RE: Kernel bug with UNIX sockets not detecting other end gone?

From: David Schwartz (davids@webmaster.com)
Date: Thu May 17 2001 - 19:32:34 EST


> Hmm - there's definitely a Linux inconsistency here. With SOCK_DGRAM,
> read() is blocking but write() is giving ECONNRESET.
>
> The ECONNRESET makes sense to me (despite this being a datagram socket),
> because the sockets are anonymous. Once one end goes away, the other end
> is pretty useless.
>
> Cheers
> Chris

        One can justify any behavior, since this is a datagram socket but the
kernel does know that it has been 'disconnected'. One can even justify the
inconcsistent behavior -- the write definitely has no place to go (now), but
the read can't be totally sure that there is no possible way anybody could
ever find the other end and write to it. I think it would, however, be
preferable to have it return ECONNRESET in all cases (read, write, and
'select'/'poll' should hit on read and write).

        DS

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



This archive was generated by hypermail 2b29 : Wed May 23 2001 - 21:00:25 EST