On Thu, Jul 20, 2017 at 4:17 PM, Lubo Astinov <[email protected]> wrote:
> "In general, there is no foolproof way to detect a peer that went away
> without terminating the connection.  The best you can do are
> heuristics like "at least one message every two minutes." "
>
> Wow, OK. Thanks for the quick reply. I would have imagined that the uv_write
> call would fail or I would get a 'on disconnected' callback or something of
> the sort. So you literally have to keep your own heartbeat messages going
> with libuv?

Not just libuv, it's how TCP works.  The connection will time out if
you wait long enough but that can take hours.

Note that we are specifically discussing peers that go away without
saying goodbye.  Proper termination through a TCP FIN or RST results
in the write callback getting called (because the operating system
passes on that information to libuv.)

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

Reply via email to