libev and sockets question

Marc Lehmann schmorp at
Fri Feb 13 16:36:30 CET 2009

On Fri, Feb 13, 2009 at 02:36:40PM +0200, Leon <ljbrits at> wrote:
> to my listening socket with telnet. If I do I get a continues stream of
> recv events even though I only connect using telnet - nothing is send.

Proof that nothing is sent? telnet might try to speak telnet protocol
(thats what it is designed for).

> The recv's all fail with error EGAIN since I am using non - blocking
> sockets.

You might not have enabled out of band inline (which should be the default
on current operating systems as tcp/ip doesn't support oob data at all).

> Does anybody have an idea why a telnet connection will cause this?


> Is there a way to clear the error/data which causes the event - assuming
> the recv() does not clear it?

you need to fetch the data that the kernel has ready for you, presumably.

> Using: FreeBSD with poll backend and libev 3.45

bsds are indeed often very buggy w.r.t. urgent data in tcp and might enforce
some kind of psuedo-oob, causing problems like these.

                The choice of a       Deliantra, the free code+content MORPG
      -----==-     _GNU_    
      ----==-- _       generation
      ---==---(_)__  __ ____  __      Marc Lehmann
      --==---/ / _ \/ // /\ \/ /      pcg at
      -=====/_/_//_/\_,_/ /_/\_\

More information about the libev mailing list