From owner-freebsd-hackers Thu Nov 14 17:56:41 1996 Return-Path: owner-hackers Received: (from root@localhost) by freefall.freebsd.org (8.7.5/8.7.3) id RAA02107 for hackers-outgoing; Thu, 14 Nov 1996 17:56:41 -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 RAA02100 for ; Thu, 14 Nov 1996 17:56:38 -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 TAA08574; Thu, 14 Nov 1996 19:53:22 -0600 (CST) Received: from Mercury.mcs.net (karl@Mercury.mcs.com [192.160.127.80]) by Mailbox.mcs.com (8.8.2/8.8.2) with ESMTP id TAA12446; Thu, 14 Nov 1996 19:53:21 -0600 (CST) Received: (from karl@localhost) by Mercury.mcs.net (8.8.2/8.8.2) id TAA23161; Thu, 14 Nov 1996 19:53:20 -0600 (CST) From: Karl Denninger Message-Id: <199611150153.TAA23161@Mercury.mcs.net> Subject: Re: Sockets question... To: jgreco@brasil.moneng.mei.com (Joe Greco) Date: Thu, 14 Nov 1996 19:53:20 -0600 (CST) Cc: scrappy@ki.net, jdp@polstra.com, hackers@freebsd.org In-Reply-To: <199611142248.QAA26418@brasil.moneng.mei.com> from "Joe Greco" at Nov 14, 96 04:48:09 pm X-Mailer: ELM [version 2.4 PL24] Content-Type: text Sender: owner-hackers@freebsd.org X-Loop: FreeBSD.org Precedence: bulk > > > On Thu, 14 Nov 1996, John Polstra wrote: > > > > > > Basically, the server opens up a binary file and sends the data > > > > to the client. The client is connecting to the server no problem, but I'm > > > > don't seem to be able to send >79 bytes across the socket > > > > > > What happens? Does it hang? Is data lost? It should work fine. > > > > At 1024, data seems to be lost. I send 1023 bytes across, and > > receive 4...send 1023, receive 907...I send across 100 packets, receive > > 2... > > > > As soon as I go to 512 or 80 byte writes, I can pound at it > > repeatedly and get the complete image across every time, no errors. > > Are you checking the return value from write() to make sure it actually > thinks that N bytes were _written_? > > ... JG Uh, hang on a second... Are you saying that the behavior of a *TCP* connection is such that you would expect to see a write(2) call to the socket come back with a short count for any reason other than the remote having closed or some other kind of transport error (ie: host unreachable, etc)? That may well be technically *legal*, but its *NOT* the behavior that a LOT of applications depend on, nor is it behavior I've seen from *ANY* other Unix system at any time in the past five years! Now UDP can (and does) come back with short counts if buffer space is low. And we all know that read()s can return short counts (and frequently do). I'm questioning write(2) behavior to TCP sockets here. -- -- 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