2017-04-17 19:05 GMT+03:00 Kevin Johnson <
jkevi...@gmail.com>:
> Hi Vasiliy,
>
> I spent a few minutes looking at your program and a couple things jumped out
> at me. As you are probably aware, writes on a network socket usually return
> the number of bytes written, This is because if the TCP buffer fills, then
> the write call will return only the amount that got added. I noticed you
> used a timeout on the TCP conn, which probably puts the connection into
> non-blocking mode. I would be surprised if binary.write was smart enough to
> attempt multiple writes in case of a partial write. You might try removing
> the time-out and see if that has any effect. (Network non-blocking writes
> may wait for the entire write to succeed before returning). You might also
> use the binary.write to write to a local block of bytes and then use the
> conn send to send them manually, resending the parts when the writes only
> partially complete.