2014-04-26 19:09 GMT+02:00 Ashish <[email protected]>:
> On Windows, if a server is down, uv_tcp_connect (trying to connect to the
> server) takes too long (almost 20 seconds) before it invokes callback
> (uv_connect_cb).
>
> (In the distributed computing environment this hampers overall system when
> one of the servers suddenly goes down)
>
> How can this issue be addressed? Afterall what decides this time duration?
> Is there any way to reduce it?

In Linux the TCP connection timeout is a configurable kernel setting.
In Windows no idea.

Anyhow, you can keep a state (connected = 1/0) and run a uv_timer that
fires after N seconds, checks the connected value (which is set to 1
in the on_connect_cb) and, in case it is still 0, then call to
uv_close() for the TCP handle and continue with your desired logic.


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