Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP
Posting-Version: version B 2.10.2 9/12/84; site nbs-amrf.UUCP
Path: utzoo!watmath!clyde!burl!ulysses!allegra!mit-eddie!genrad!panda!talcott!harvard!seismo!umcp-cs!nbs-amrf!libes
From: libes@nbs-amrf.UUCP (Don Libes)
Newsgroups: net.unix-wizards,net.lan
Subject: why can (size != write(tcp_socket,buffer,size))?
Message-ID: <48@nbs-amrf.UUCP>
Date: Sun, 3-Nov-85 15:49:48 EST
Article-I.D.: nbs-amrf.48
Posted: Sun Nov  3 15:49:48 1985
Date-Received: Sun, 10-Nov-85 09:22:53 EST
Distribution: net
Organization: National Bureau of Standards
Lines: 15
Xref: watmath net.unix-wizards:15655 net.lan:1135

After opening a TCP socket and doing a large number of successful reads and
writes (I always check the return value of write), write suddenly reports
that it has only written a partial buffer.  

I am wondering if this is a flow-control problem in that the writer is
getting too far ahead of the reader.  I would have expected the write to
block just like a pipe.  If this is the problem, is there some option I
should set or am I supposed to handle flow-control myself on top of TCP?

I'm grasping at straws, however and don't really think that's the problem.
So anyway, what are the possible reasons for write returning a size that is
positive but less than the requested size.  (Oh, and yes, I'm sure that
the process at the other end is still alive and didn't close the socket.)

Don Libes       {seismo,umcp-cs}!nbs-amrf!libes