Re: using unix domain socket get ENOTCONN in both 6.2 and 7.0

From: Peter Jeremy <peterjeremy_at_optushome.com.au>
Date: Mon, 17 Sep 2007 21:51:05 +1000
On 2007-Sep-17 16:12:41 +0800, Deng XueFeng <dengxf_at_gmail.com> wrote:
>then I write a test program, and can reproduce in 6.2 and 7.0

Read() and write() do not preserve message boundaries so you cannot
guarantee to read 8193 bytes just because you wrote 8193 bytes.

>#./ud_test
>child recv len [4992] failed: Unknown error: 0

This is an error in your program:  The read() succeeded and returned
4992 bytes.  The child then exits

>main send len [-1] failed: Socket is not connected

Which leaves the socket unconnected so the parent (correctly) receives
an error.

-- 
Peter Jeremy

Received on Mon Sep 17 2007 - 09:51:09 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:39:17 UTC