On 10/02/2016 02:21 PM, Elad Nachmias wrote:
> When using tcp sockets, I understand that the right practice is using
> libuv tcp handles. I'm already using a library that is working with
> sockets (that has been set to O_NONBLOCK). The library expect me to call
> it's methods when the socket become readable, so it could read
> asynchronously from the socket. The library used to work with libevent.
> I've adapted it to work with libuv using the uv_poll_t handle.
> 
> What are the disadvantages of working with regular IO system calls
> (read/write) on a socket (that set to O_NONBLOCK), over using uv_tcp_t
> handle with the uv read/write operation?
> 

uv_tcp_t gives you queued writes, handles cross platform differences,
and so on.

Some libraries handle this themselves, you just need to tell them a
socket is readable / writable, and uv_poll_t is what you want to use in
that case. An example of such library is c-ares.


Cheers,

-- 
Saúl Ibarra Corretgé
bettercallsaghul.com


-- 
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 [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/libuv.
For more options, visit https://groups.google.com/d/optout.

Attachment: signature.asc
Description: OpenPGP digital signature

Reply via email to