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

David Schwartz (davids@webmaster.com)
Thu, 17 May 2001 17:32:34 -0700


> 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/