forgot cc.... 由 Deng XueFeng <dengxf_at_gmail.com> 转发: ----------------------- 原邮件起始位 ----------------------- From: "Deng XueFeng" <dengxf_at_gmail.com> To: "Peter Jeremy" <peterjeremy_at_optushome.com.au> Date: Mon, 17 Sep 2007 21:06:33 +0800 Subject: Re: using unix domain socket get ENOTCONN in both 6.2 and 7.0 ---- yes, i do not chech anything, because i want create a race between close(2) and write(2) int the parent process, the write(2) should not return ENOTCONN. in 2005, there was one like this: http://lists.freebsd.org/pipermail/freebsd-bugs/2005-March/012123.html 2007/9/17, Peter Jeremy <peterjeremy_at_optushome.com.au>: > > 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 > > --------------------- 原邮件结束位 -------------------- -- Deng XueFeng <dengxf_at_gmail.com> yes, i do not chech anything, because i want create a race between close(2) and write(2) int the parent process, the write(2) should not return ENOTCONN. in 2005, there was one like this: [1]http://lists.freebsd.org/pipermail/freebsd-bugs/2005-March/012123.h tml 2007/9/17, Peter Jeremy <[2]peterjeremy_at_optushome.com.au>: On 2007-Sep-17 16:12:41 +0800, Deng XueFeng <[3]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 References 1. http://lists.freebsd.org/pipermail/freebsd-bugs/2005-March/012123.html 2. mailto:peterjeremy_at_optushome.com.au 3. mailto:dengxf_at_gmail.comReceived on Mon Sep 17 2007 - 23:52:35 UTC
This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:39:17 UTC