Writing to a TCP socket
write might not be able to write all bytes
(on a nonblocking socket).