2014-05-25 10:50 GMT+02:00 Saúl Ibarra Corretgé <[email protected]>:
> Not sure what trying to achieve... you'll be notified about handle's
> state in the callbacks, in care things go wrong.

- uv_tcp_bind() fails before uv_run() if the address is not available.
- uv_pipe_open() fails *after* uv_run() if the given fd is invalid (it
fires a on_read_cb with error status).

Get my point? I need to know *when* exactly I can ensure that my
handles are working.


> Now, the NOWAIT trick might have worked for you in tests, but I don't
> think it's reliable. It does a 0 tiemout poll, so it's possible that
> no i/o is performed in that loop iteration.

Sure, but it is good enough to detect a bad fd given to
uv_pipe_open(). This is: if the fd is invalid UV calls to on_read_cb
with the corresponding error (even in NOWAIT mode) so I can close the
handle. Then I inspect the return value of uv_run() and, since it is
0, I detect that an issue happened.




> If you want to be sure you don't run out of fds when creating servers,
> just use uv_*_bind. That will create and bind the socket on the spot.

Yeah, but I don't want named pipes.


Thanks a lot.



-- 
Iñaki Baz Castillo
<[email protected]>

-- 
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 http://groups.google.com/group/libuv.
For more options, visit https://groups.google.com/d/optout.

Reply via email to