Hang in fd_ebadf function

Marc-André Cournoyer macournoyer at gmail.com
Tue Jun 3 05:31:22 CEST 2008

What I'm doing is: if the EV_ERROR bit is set, close the connection  
right away. I'm also closing the connection if there's any error send- 
ing or recv-ing on a socket.

By "it works" I meant that it stoped hanging when there was an error  
on the socket before the send or recv.

Let me know if you think I'm doing something wrong.

But I know there is still something weird in there when using Ruby  
threads, I'm trying to figure it out.


On 30-May-08, at 6:51 PM, Marc Lehmann wrote:

> On Fri, May 30, 2008 at 10:12:45AM -0400, Marc-André Cournoyer <macournoyer at gmail.com 
> > wrote:
>> Perfect, it works now w/ checking the EV_ERROR bit, thx Marc!
> No, it doesn't - if you get EV_ERROR for this case then your code is  
> buggy
> - you *must not* have active watchers with illegal file descriptors.
> The fact that libev tries to work around your bug doesn't mean it  
> works
> (in fact, you are relying on luck because this bug isn't 100%  
> detectable
> in libev).
> -- 
>                The choice of a       Deliantra, the free code 
> +content MORPG
>      -----==-     _GNU_              http://www.deliantra.net
>      ----==-- _       generation
>      ---==---(_)__  __ ____  __      Marc Lehmann
>      --==---/ / _ \/ // /\ \/ /      pcg at goof.com
>      -=====/_/_//_/\_,_/ /_/\_\

More information about the libev mailing list