> 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>

-- 
You received this message because you are subscribed to the Google Groups 
"libuv" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to libuv+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/libuv/CALiegf%3DGvkt4wU2y2DoOzxAhFecmi5PmDPfShiRqWOKZOQD-BQ%40mail.gmail.com.

Reply via email to