How to detect dead peer quickly in AnyEvent::Handle?

Michael Fung mike at 3open.org
Mon Feb 25 08:47:12 CET 2013


Dear all,

I have these in an AnyEvent::Handle:

[code]
wtimeout => KEEPALIVE_INTERVAL,

on_wtimeout => sub{
   my $hdl = shift;
   $hdl->push_write ("KEEPALIVE" . $CRLF);
},

on_error => sub { # destroy handle... }
[/code]

This works but it takes very long to detect dead peers.

I prefer not to have peer to send data as ACK to save bandwidth.
I want to detect dead peers just by checking outstanding tcp ACK in 
on_wtimeout. Is it possible and how?

Sorry if it is not related to AnyEvent.


Thanks,
Michael



More information about the anyevent mailing list