From owner-freebsd-current@FreeBSD.ORG Mon Sep 17 11:51:09 2007 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9632316A420 for ; Mon, 17 Sep 2007 11:51:09 +0000 (UTC) (envelope-from peterjeremy@optushome.com.au) Received: from turion.vk2pj.dyndns.org (c220-239-20-82.belrs4.nsw.optusnet.com.au [220.239.20.82]) by mx1.freebsd.org (Postfix) with ESMTP id 206F313C494 for ; Mon, 17 Sep 2007 11:51:08 +0000 (UTC) (envelope-from peterjeremy@optushome.com.au) Received: from turion.vk2pj.dyndns.org (localhost.vk2pj.dyndns.org [127.0.0.1]) by turion.vk2pj.dyndns.org (8.14.1/8.14.1) with ESMTP id l8HBp5ff002136; Mon, 17 Sep 2007 21:51:05 +1000 (EST) (envelope-from peter@turion.vk2pj.dyndns.org) Received: (from peter@localhost) by turion.vk2pj.dyndns.org (8.14.1/8.14.1/Submit) id l8HBp586002135; Mon, 17 Sep 2007 21:51:05 +1000 (EST) (envelope-from peter) Date: Mon, 17 Sep 2007 21:51:05 +1000 From: Peter Jeremy To: Deng XueFeng Message-ID: <20070917115105.GH1163@turion.vk2pj.dyndns.org> References: <20070917160248.003B.DENGXF@gmail.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="nFreZHaLTZJo0R7j" Content-Disposition: inline In-Reply-To: <20070917160248.003B.DENGXF@gmail.com> X-PGP-Key: http://members.optusnet.com.au/peterjeremy/pubkey.asc User-Agent: Mutt/1.5.16 (2007-06-09) Cc: freebsd-current@freebsd.org Subject: Re: using unix domain socket get ENOTCONN in both 6.2 and 7.0 X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Sep 2007 11:51:09 -0000 --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 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--