-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 05/24/2014 06:09 PM, Iñaki Baz Castillo wrote:
> 2014-05-24 17:37 GMT+02:00 Iñaki Baz Castillo <[email protected]>:
>> uv_check and uv_prepare don't are valid for me in this case:
>> 
>> - The check cb does not fire until blocking ends.
>> 
>> - The prepare db fires before other handles are even started
>> (for example, if I use uv_pipe_open() by passing it a bad fd, I
>> get a read cb inidicating the error much later than the prepare
>> cb.
>> 
>> Should I run uv_run() with UV_RUN_NOWAIT and use a uv_check (so
>> in its cb I can be 100% sure that other handles won't fail
>> later)?
> 
> 
> Ok, running uv_run(NOWAIT) does the trick. If it returns 0 it
> means that there are no more active handles (so those that are
> supposed to be failed and are closed). No need for uv_check or
> uv_prepare at all.
> 

Not sure what trying to achieve... you'll be notified about handle's
state in the callbacks, in care things go wrong.

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.

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.

- -- 
Saúl Ibarra Corretgé
bettercallsaghul.com

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1
Comment: Using GnuPG with Icedove - http://www.enigmail.net/

iQIcBAEBAgAGBQJTga7fAAoJEEEOVVOum8BZuyYP/158y1Dpv0NtQ96L/bOb/ku6
Z88Y05x/DSpEkjlkkN0Eb0KK3qb9Ur9ZwkNOGBd1AiKvw51qMhAA9YeC0HUt9IY+
KljOBsC0bn6qjlL1RvmbmgMQdGNC9qBjR0VH3/guc7LUOYcLllHSJWExlgo3fgSI
595kJT0S90dRO9iuQF/y/K91foILMNx1pzKc/Ap34+vcfKc1GQjFzt7LASZcw4vo
DYP1b8zg5LOpGpWXaEna9gZkOiAnUFaPgaHR3PvfmW9sO6HGr8idrzGwl6HUctNC
q9aqvNu/cUcY0ppQBqj4BocIHGpUt35HjHKPNRkTsBwDoHlG+7UGuxH0y9yu6gsm
5xF4I6PXFRliANpWsfPfo8a4xZkwspdhyTbMH6x9+9NizKyVUt4F9cbhrk7EyK2P
LmLhZuadi/iWd5F44fu6EI+93q3MNIsNS6vsIdCifvvgtmLSoqFKm5gJBoaiCHqd
If+Z0uxIJP8+nV5YFeuQddN87cEHoBaOaNqh5AXC0yeTs2rGtz4CURcbJSbA2Err
9Cvdwkqx5/MUPC4U2zCqFBPfRVBTFm+nbJZ2PM4iV06EQS8mReB7V3mRg2l+CPf7
EGtZ5E5GfuHM6Wjs1+akD3Jk6uuewxNOZM0hbYXLP4sCjL5K0TqXka8ukB2Aigxa
z5l2InmradGfeFfEHxWh
=cWJg
-----END PGP SIGNATURE-----

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