Problem with select on windows

Marc Lehmann schmorp at
Mon Jan 24 22:23:59 CET 2011

On Mon, Jan 24, 2011 at 10:04:42PM +0100, Bert Belder <bertbelder at> wrote:
> There is a problem with libev/select on windows. When a socket that is being
> observed with an ev_io watcher is closed, and the same fd gets re-used for
> another socket in the same tick (so before control to is returned to libev),
> the windows handle that is cached in ANFD->handle is not updated.

Actually, according to the code, the cached handle gets updated on every
start of an I/O watcher that has it's fd updated.

Are you sure you stop/set/start the watcher? (See "The special problem of
disappearing file descriptors").

If you do, can you make a small testcase the illustrates the problem? I
can't see how it can not update the cached fd (there might be a problem
with updating it, but that doesn't seem to be what you see).

> Is there a better solution to this problem?
> And if not, any chance that this patch could be landed?

It should just work, and if it doesn't, it needs to be made to work.

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

More information about the libev mailing list