From owner-freebsd-hackers Fri Nov 15 13:23:27 1996 Return-Path: owner-hackers Received: (from root@localhost) by freefall.freebsd.org (8.7.5/8.7.3) id NAA17134 for hackers-outgoing; Fri, 15 Nov 1996 13:23:27 -0800 (PST) Received: from phaeton.artisoft.com (phaeton.Artisoft.COM [198.17.250.211]) by freefall.freebsd.org (8.7.5/8.7.3) with SMTP id NAA17126 for ; Fri, 15 Nov 1996 13:23:19 -0800 (PST) Received: (from terry@localhost) by phaeton.artisoft.com (8.6.11/8.6.9) id OAA26956; Fri, 15 Nov 1996 14:09:35 -0700 From: Terry Lambert Message-Id: <199611152109.OAA26956@phaeton.artisoft.com> Subject: Re: Sockets question... To: fenner@parc.xerox.com (Bill Fenner) Date: Fri, 15 Nov 1996 14:09:34 -0700 (MST) Cc: terry@lambert.org, fenner@parc.xerox.com, scrappy@ki.net, jdp@polstra.com, hackers@FreeBSD.org In-Reply-To: <96Nov15.113305pst.177557@crevenia.parc.xerox.com> from "Bill Fenner" at Nov 15, 96 11:32:55 am X-Mailer: ELM [version 2.4 PL24] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: owner-hackers@FreeBSD.org X-Loop: FreeBSD.org Precedence: bulk > In message <199611151858.LAA26626@phaeton.artisoft.com> you write: > >So at the "read" interface, you *can* count on it arriving in the > >same sized chunks as you wrote it > > No, you can *never* count on that, since non-blocking reads from a stream > socket return as much data as is available, which could be less than you > asked for. See soo_read() (or soo_rw() in earlier BSD's) and soreceive(). > > 4.4BSD introduced the MSG_WAITALL flag, so if you use recv() or any of its > friends you can ask for your whole request to be performed. This is, of > course, not portable, and MSG_WAITALL won't even do the trick if your > request is larger than the socket's high water mark (e.g. SO_RECVBUF). Maybe this is where I'm confused. I was under the impression that the MSG_WAITALL was for messages that had to be passed up to free up the receive buffer, and was put there to allow the copy to the user buffer to occur in SO_RECVBUF-sized chunks. Again, we aren't really interested in the non-blocking socket case... Terry Lambert terry@lambert.org --- Any opinions in this posting are my own and not those of my present or previous employers.