From mboxrd@z Thu Jan 1 00:00:00 1970 From: Grant Edwards To: "Trenton D. Adams" Cc: 'Jonathan Larmour' , 'eCos Discussion' , 'Gary Thomas' Subject: Re: [ECOS] TCP/IP Stack packet regrouping Date: Mon, 16 Jul 2001 17:43:00 -0000 Message-id: <20010716194337.B888@visi.com> References: <20010716171044.A11299@visi.com> <000b01c10e47$9938fc00$090110ac@TRENT> X-SW-Source: 2001-07/msg00501.html On Mon, Jul 16, 2001 at 04:35:20PM -0600, Trenton D. Adams wrote: >>>>> Sending generally will send it all at once, and there's no >>>>>need for a loop for the outgoing buffer? >>> >>>> 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? > >> I didn't write it, but I'm reading it. :) > >> In the eCos/BSD stack, it looks to me that send() is only >> "atomic" if the PR_ATOMIC flag is set in the protosw struct >> for the protocol associated with a socket. That flag isn't >> set for SOCK_STREAM. It is set for SOCK_DGRAM and SOCK_RAW. >> Of course, I could be misreading the code. But that does jibe >> with what I've always been told regarding checking the return >> value from a write() on a TCP socket. > > I THINK this is the opposite of the Linux version. The Linux > TCP version is APPARENTLY atomic. I used to know what this > means in computer terms, but I can't remember. Can you explain > the ATOMIC thing to me? I'm still not 100% sure that the eCos/BSD stack won't try to loop until all of the data is sent. I have a really tough time reading C code that's indented that way. I'm going to have to re-indent the eCos sources and study it some more. -- Grant Edwards grante@visi.com