From owner-freebsd-hackers Fri Nov 15 11:28:02 1996 Return-Path: owner-hackers Received: (from root@localhost) by freefall.freebsd.org (8.7.5/8.7.3) id LAA10470 for hackers-outgoing; Fri, 15 Nov 1996 11:28:02 -0800 (PST) Received: from alpha.xerox.com (alpha.Xerox.COM [13.1.64.93]) by freefall.freebsd.org (8.7.5/8.7.3) with SMTP id LAA10461 for ; Fri, 15 Nov 1996 11:27:54 -0800 (PST) Received: from crevenia.parc.xerox.com ([13.2.116.11]) by alpha.xerox.com with SMTP id <16010(3)>; Fri, 15 Nov 1996 11:26:48 PST Received: from localhost ([127.0.0.1]) by crevenia.parc.xerox.com with SMTP id <177557>; Fri, 15 Nov 1996 11:24:19 -0800 X-Mailer: exmh version 1.6.7 5/3/96 To: Terry Lambert cc: jdp@polstra.com (John Polstra), scrappy@ki.net, jgreco@brasil.moneng.mei.com, hackers@freebsd.org Subject: Re: Sockets question... In-reply-to: Your message of "Fri, 15 Nov 1996 09:06:54 PST." <199611151706.KAA26239@phaeton.artisoft.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Fri, 15 Nov 1996 11:24:14 PST From: Bill Fenner Message-Id: <96Nov15.112419pst.177557@crevenia.parc.xerox.com> Sender: owner-hackers@freebsd.org X-Loop: FreeBSD.org Precedence: bulk In message <199611151706.KAA26239@phaeton.artisoft.com> Terry wrote: >How do I read into a structure on a machine that demands aligned >data access? You read into an intermediate buffer and copy it. You have to convert from network to machine representation anyway, so this isn't (much) more overhead. Or you use UDP if you want a record-oriented protocol. >nothing would work at all if you couldn't issue a read for n >bytes that didn't complete until you *got* n bytes. Well, I guess the BSD networking code has probably never worked at all. The read() system call on a socket is based on soreceive(), which returns up to N bytes. Bill