Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 17 Sep 2007 21:51:05 +1000
From:      Peter Jeremy <peterjeremy@optushome.com.au>
To:        Deng XueFeng <dengxf@gmail.com>
Cc:        freebsd-current@freebsd.org
Subject:   Re: using unix domain socket get ENOTCONN in both 6.2 and 7.0
Message-ID:  <20070917115105.GH1163@turion.vk2pj.dyndns.org>
In-Reply-To: <20070917160248.003B.DENGXF@gmail.com>
References:  <20070917160248.003B.DENGXF@gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help

--nFreZHaLTZJo0R7j
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

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.

--=20
Peter Jeremy

--nFreZHaLTZJo0R7j
Content-Type: application/pgp-signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.7 (FreeBSD)

iD8DBQFG7moo/opHv/APuIcRAr0LAJ9Q0Y9UZDG0YbQRjSVFjsrcikp5ewCfZD6Y
6Z87lTVREmFdAB1ae1m6B/c=
=5dXH
-----END PGP SIGNATURE-----

--nFreZHaLTZJo0R7j--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20070917115105.GH1163>