Date: Tue, 18 Sep 2007 09:52:31 +0800 From: Deng XueFeng <dengxf@gmail.com> To: freebsd-current@freebsd.org, peterjeremy@optushome.com.au Subject: Fw: Re: using unix domain socket get ENOTCONN in both 6.2 and 7.0 Message-ID: <20070918095036.1B14.DENGXF@gmail.com>
index | next in thread | raw e-mail
[-- Attachment #1 --] forgot cc.... 由 Deng XueFeng <dengxf@gmail.com> 转发: ----------------------- 原邮件起始位 ----------------------- From: "Deng XueFeng" <dengxf@gmail.com> To: "Peter Jeremy" <peterjeremy@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@optushome.com.au>: > > On 2007-Sep-17 16:12:41 +0800, Deng XueFeng <dengxf@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@gmail.com> [-- Attachment #2 --] 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@optushome.com.au>: On 2007-Sep-17 16:12:41 +0800, Deng XueFeng <[3]dengxf@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@optushome.com.au 3. mailto:dengxf@gmail.comhome | help
Want to link to this message? Use this
URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20070918095036.1B14.DENGXF>
