Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 14 Nov 1996 19:53:20 -0600 (CST)
From:      Karl Denninger  <karl@Mcs.Net>
To:        jgreco@brasil.moneng.mei.com (Joe Greco)
Cc:        scrappy@ki.net, jdp@polstra.com, hackers@freebsd.org
Subject:   Re: Sockets question...
Message-ID:  <199611150153.TAA23161@Mercury.mcs.net>
In-Reply-To: <199611142248.QAA26418@brasil.moneng.mei.com> from "Joe Greco" at Nov 14, 96 04:48:09 pm

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



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