joyent/libuv — pull request #1354 by saghul (2014-07-04 18:49:58+00:00)
Title: unix: return UV_EAGAIN if uv_try_write cannot write any data

For consistency with `uv_udp_try_send`.

Yes, UDP and TCP are different but I think it reasonable to think users will expect the same behavior on both cases. The reason why we return EAGAIN on UDP is bbecause sending an empty datagram is allowed, so we need to know if what happened is that the datagram could not be sent vs an empty datagram was sent. We cannot send an empty TCP packet, but still IMHO consistent behavior is a Good Thing (TM) in this case.

/cc @indutny

@txdv come and agree with me here :-)