This is the mail archive of the
ecos-discuss@sources.redhat.com
mailing list for the eCos project.
Re: TCP/IP Stack packet regrouping
- To: "Trenton D. Adams" <tadams at extremeeng dot com>
- Subject: Re: [ECOS] TCP/IP Stack packet regrouping
- From: Grant Edwards <grante at visi dot com>
- Date: Mon, 16 Jul 2001 20:13:39 -0500
- Cc: 'Jonathan Larmour' <jlarmour at redhat dot com>, 'eCos Discussion' <ecos-discuss at sourceware dot cygnus dot com>, 'Gary Thomas' <gthomas at redhat dot com>
- References: <20010716162741.A11222@visi.com> <000801c10e40$84c95f50$090110ac@TRENT>
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