Date: Thu, 14 Nov 1996 20:46:55 -0600 (CST) From: Karl Denninger <karl@Mcs.Net> To: jdp@polstra.com (John Polstra) Cc: scrappy@ki.net, jgreco@brasil.moneng.mei.com, hackers@FreeBSD.org Subject: Re: Sockets question... Message-ID: <199611150246.UAA13803@Jupiter.Mcs.Net> In-Reply-To: <199611150002.QAA10843@austin.polstra.com> from "John Polstra" at Nov 14, 96 04:02:52 pm
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 Don't bet on it. I'm seeing this behavior from -current too. See my other post regarding this subject. I have an application which sends a query to a back-end server -- and that server can return literally hundreds of KB of data in response. On very long responses, it just STOPS. The writing end thinks it wrote all of the data, netstat -an shows nothing in the socket buffers, the reader is waiting in read() for more data (it never saw the end marker, and in fact never saw more than half of the response!) -- -- Karl Denninger (karl@MCS.Net)| MCSNet - The Finest Internet Connectivity http://www.mcs.net/~karl | T1's from $600 monthly to FULL DS-3 Service | 32 Analog Prefixes, 13 ISDN, Web servers $75/mo Voice: [+1 312 803-MCS1 x219]| Email to "info@mcs.net" WWW: http://www.mcs.net/ Fax: [+1 312 248-9865] | 2 FULL DS-3 Internet links; 400Mbps B/W Internal
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199611150246.UAA13803>