socket write(2) after remote shutdown(2) problem ?

From: Stelian Pop (stelian.pop@fr.alcove.com)
Date: Fri Apr 05 2002 - 04:50:39 EST


Hi,

Is the following behaviour correct on a tcp connection:
        * the server issues a shutdown(sock, RW)
        * the client side socket passes in CLOSE-WAIT state
        * the client issues a write on the socket which succeds.

I expected the last write to fail, since the other side is not
capable any more to receive data. Can someone confirm to me one
of the following:
        1. behaviour is correct and why.
        2. shutdown is buggy.
        3. write is buggy.

Thanks.

Attached are sample codes for the "server" and the "client". Test
was done on latest 2.4 and 2.5 kernels.

Stelian.

-- 
Stelian Pop <stelian.pop@fr.alcove.com>
Alcove - http://www.alcove.com



- 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 : Sun Apr 07 2002 - 22:00:16 EST