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

Marc Lehmann schmorp at schmorp.de
Fri Mar 1 11:53:55 CET 2013


On Thu, Feb 28, 2013 at 09:49:46PM +0800, Michael Fung <mike at 3open.org> wrote:
> I fiddled with this new socket option for some time and could not
> find a way to set it in a perl script.

You need to call setsockopt on the handle directly - AnyEvent::Handle
cannot offer OS/Kernel-specific options, it has to work on more than just
recent linux kernels.

Getting at the actual constant value is difficult. You either hardcode it,
or, best, write an XS module for it.

All of this is out of the scope for AnyEvent::Handle - you have to set the
option before passing the file handle to AnyEvent::Handle.

AnyEvent:Handle, however, will work just fine with such a handle.

-- 
                The choice of a       Deliantra, the free code+content MORPG
      -----==-     _GNU_              http://www.deliantra.net
      ----==-- _       generation
      ---==---(_)__  __ ____  __      Marc Lehmann
      --==---/ / _ \/ // /\ \/ /      schmorp at schmorp.de
      -=====/_/_//_/\_,_/ /_/\_\



More information about the anyevent mailing list