Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 15 Nov 1996 14:09:34 -0700 (MST)
From:      Terry Lambert <terry@lambert.org>
To:        fenner@parc.xerox.com (Bill Fenner)
Cc:        terry@lambert.org, fenner@parc.xerox.com, scrappy@ki.net, jdp@polstra.com, hackers@FreeBSD.org
Subject:   Re: Sockets question...
Message-ID:  <199611152109.OAA26956@phaeton.artisoft.com>
In-Reply-To: <96Nov15.113305pst.177557@crevenia.parc.xerox.com> from "Bill Fenner" at Nov 15, 96 11:32:55 am

next in thread | previous in thread | raw e-mail | index | archive | help
> 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.



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