Date: Thu, 14 Nov 1996 16:02:52 -0800 From: John Polstra <jdp@polstra.com> To: "Marc G. Fournier" <scrappy@ki.net> Cc: Joe Greco <jgreco@brasil.moneng.mei.com>, hackers@FreeBSD.org Subject: Re: Sockets question... Message-ID: <199611150002.QAA10843@austin.polstra.com> In-Reply-To: Your message of "Thu, 14 Nov 1996 18:47:16 EST." <Pine.NEB.3.95.961114184658.11486C-100000@quagmire.ki.net> References: <Pine.NEB.3.95.961114184658.11486C-100000@quagmire.ki.net>
next in thread | previous in thread | raw e-mail | index | archive | help
> > Are you checking the return value from write() to make sure it actually > > thinks that N bytes were _written_? > > > *sigh* Well now, wait a minute. As long as you haven't set the socket for non-blocking I/O, the write will always block until it's written the full N bytes that you asked for. In other words, the write will always return either -1 or N. Only if it's set up for non-blocking I/O can it return a short count. Writes are different from reads in this respect. John -- John Polstra jdp@polstra.com John D. Polstra & Co., Inc. Seattle, Washington USA "Self-knowledge is always bad news." -- John Barth
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199611150002.QAA10843>