How to detect dead peer quickly in AnyEvent::Handle?
Michael Fung
mike at 3open.org
Tue Feb 26 00:48:23 CET 2013
Dear Marc,
Many thanks. Indeed it is a tcp related issue. I will try the
TCP_USER_TIMEOUT socket option if it is available on my system. For
others interested, you can see:
http://stackoverflow.com/questions/4181784/how-to-set-socket-timeout-in-c-when-making-multiple-connections
Thanks again.
-Michael
On 2/26/2013 5:40 AM, Marc Lehmann wrote:
> On Mon, Feb 25, 2013 at 08:16:59AM -0500, Fulko Hew <fulko.hew at gmail.com> wrote:
>>> I want to detect dead peers just by checking outstanding tcp ACK in
>>> on_wtimeout. Is it possible and how?
>
> Whether a peer is dead is determined by the protocol in question, in this
> case, tcp. The lack of on ack within a fixed time does not indicate a dead
> peer.
>
> If you want your own nonstandard defintiion of dead peer (such as, no tcp ack
> received within xxx seconds), then there is no portable way to do that. With
> linux you can try the TCP_INFO socket option for example.
>
More information about the anyevent
mailing list