From owner-freebsd-hackers Tue Jan 25 9:10:16 2000 Delivered-To: freebsd-hackers@freebsd.org Received: from moffetimages.com (alar.scruz.predictive.com [207.251.1.130]) by hub.freebsd.org (Postfix) with ESMTP id 754F714EB6 for ; Tue, 25 Jan 2000 09:10:14 -0800 (PST) (envelope-from brianm@moffetimages.com) Received: (from brianm@localhost) by moffetimages.com (8.9.3/8.9.3) id JAA41726 for freebsd-hackers@freebsd.org; Tue, 25 Jan 2000 09:12:31 -0800 (PST) (envelope-from brianm) Date: Tue, 25 Jan 2000 09:12:31 -0800 (PST) From: "Brian D. Moffet" Message-Id: <200001251712.JAA41726@moffetimages.com> To: freebsd-hackers@freebsd.org Subject: Re: Performance issue with rfork() and single socketpairs versus multiple socketpairs. In-Reply-To: <200001250124.BAA36765@hak.lan.Awfulhak.org> Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG Okay, stupid question. socketpair returns 2 sockets which according to the man page are "indistinguishable". Does this mean that you can read and write to either socket pair? pipe(2) returns 2 file descriptors, one of which is a read and one of which is a write fd. The other end flips these around, and data is not mixed up that way. One program cannot read and write to the same file descriptor, with the expectation that the two ends of the pipe will be able to properly communicate. Will socketpair allow one program to read and write to the same file descriptor (what I would call real "bi-directional")... Like you can do with a normal old socket? Thanks Brian > > Use 'pipe(2)' rahter than 'socketpair(2)' as both are bidirectional and > > pipe is a LOT faster. > > Although pipe(2)'s bi-directional capabilities are not standard (I've > been stung by this in the past :-() To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message