From owner-freebsd-hackers Thu Nov 14 18:51:10 1996 Return-Path: owner-hackers Received: (from root@localhost) by freefall.freebsd.org (8.7.5/8.7.3) id SAA05438 for hackers-outgoing; Thu, 14 Nov 1996 18:51:10 -0800 (PST) Received: from Kitten.mcs.com (Kitten.mcs.com [192.160.127.90]) by freefall.freebsd.org (8.7.5/8.7.3) with ESMTP id SAA05354 for ; Thu, 14 Nov 1996 18:50:23 -0800 (PST) Received: from Mailbox.mcs.com (Mailbox.mcs.com [192.160.127.87]) by Kitten.mcs.com (8.8.2/8.8.2) with ESMTP id UAA10284; Thu, 14 Nov 1996 20:46:57 -0600 (CST) Received: from Jupiter.Mcs.Net (karl@Jupiter.mcs.net [192.160.127.88]) by Mailbox.mcs.com (8.8.2/8.8.2) with ESMTP id UAA20993; Thu, 14 Nov 1996 20:46:56 -0600 (CST) Received: (from karl@localhost) by Jupiter.Mcs.Net (8.8.2/8.8.2) id UAA13803; Thu, 14 Nov 1996 20:46:56 -0600 (CST) From: Karl Denninger Message-Id: <199611150246.UAA13803@Jupiter.Mcs.Net> Subject: Re: Sockets question... To: jdp@polstra.com (John Polstra) Date: Thu, 14 Nov 1996 20:46:55 -0600 (CST) Cc: scrappy@ki.net, jgreco@brasil.moneng.mei.com, hackers@FreeBSD.org In-Reply-To: <199611150002.QAA10843@austin.polstra.com> from "John Polstra" at Nov 14, 96 04:02:52 pm X-Mailer: ELM [version 2.4 PL24] Content-Type: text Sender: owner-hackers@FreeBSD.org X-Loop: FreeBSD.org Precedence: bulk > > > > 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