No it will return FAIL (-1) or an error and 0 (the bottom of the procedure)
if the whole things went. It is mandatory that the whole thing goes
so this procedure should handle any intermediate actions.
Upon your advice, I may try to add select() although, on a write it
seems to be putting in user-space something that used to be handled
quite well in the kernel. I don't think the user should really care
about the kernel internals, whether or not the kernel happens to have
a buffer available.
I have no idea why you need to add the MIN() logic..and that seems like
something that should not be required.
It seems that some code 'thinks' that a large buffer of data is
an error and won't even try to send some anymore.
Even 112kbps sucks on a decent network. What is the speed of your
network, what protocol are you using, if tcp, what is the latency
of your network?
The network is a single wire about 8 feet long, connecting Intel gigibit
links on two identical computers (crossover cable). This link is TCP.
For high-speed data, I use UDP and I get a higher throughput because
there is no handshake. Thew latency is the latency of Linux. BTW, it's
only a gigaBIT link, you can divide that by 8 for gigabytes. I don't
know the actual bit-rate on the wires, if we assume 1GHz, the byte-rate
is only 125,000 bytes per second. Being able to use 89.6 percent of
that isn't bad at all.