> void (*uv_udp_recv_cb)(uv_udp_t* handle, ssize_t nread, const uv_buf_t* buf, const struct sockaddr* addr, unsigned flags)
>
> nread: Number of bytes that have been received. 0 if there is no more data to read. You may discard or repurpose the read buffer. Note that 0 may also mean that an empty datagram was received (in this case addr is not NULL). < 0 if a transmission error was detected.
So, if nread is < 0 it must be considered an error. However, ssize_t
can just be -1 or 0 or a positive value. So, if read operation failed,
nread will always be -1. Is that true?
And, if so, does it make sense to do this?
printf("UV UDP read error: %s", uv_strerror(nread));
Thanks.
--
Iñaki Baz Castillo
<
i...@aliax.net>