On Fri, 18 Sep 2009, Peter Stuge wrote:
"The only difference between send() and write(2) is the presence of flags."
Aha. But then send() will also succeed (and possibly return short) on a
socket which was predicted by select() to be writable.
Yes of course. But the thing is that a non-blocking send() will never block
while a blocking one might - after select() has signalled the socket to be
writable.
... and it also explains why we want to use send() and not write(). We want
the flags.
I saw a note about MSG_NOSIGNAL in your portability notes. Is this it? If
so, why is it important?
Because we don't want to bother our app with signals that isn't its business
(and we don't have any signals documented in our API). And signals don't work
properly in multi-threaded environments.
--
/ daniel.haxx.se
_______________________________________________
libssh2-devel http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel