This is the mail archive of the ecos-discuss@sources.redhat.com mailing list for the eCos project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: TCP/IP Stack packet regrouping


On Mon, Jul 16, 2001 at 03:44:40PM -0600, Trenton D. Adams wrote:

>> No, that is not generally true.  For small blocks, it will
>> _usually_ be true.  For large blocks of data, you will have to
>> check the return value from write() in a loop.  The values of
>> "small" and "large" vary from platform to platform.
> 
> Ok, who's actually correct here?  Who's the one that wrote the
> TCP/IP stack?  Are they listening?

After reindenting uipc_socket.c and looking at it some more, it
looks like the outer do/while loop in sosend() is waiting until
all data has been sent (for a blocking, stream socket).

The inner do/while loop fills up the so_snd buffer until it's
full. After the inner loop has filled up the send buffer, the
outer loop repeats the inner loop.  There ought to be someplace
in there where the task blocks waiting for more room in the
send buffer, but I cant find it.

But, the comment at the top of sosend() reads:

 * Returns nonzero on error, timeout or signal; callers
 * must check for short counts if EINTR/ERESTART are returned.
 * Data and control buffers are freed on return.

If you can guarantee that no signals are going to happen, then
you souldn't have to check for short counts. I don't like to
depend on that assumption.

-- 
Grant Edwards
grante@visi.com


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]