Problem with select on windows
bertbelder at gmail.com
Mon Jan 24 22:04:42 CET 2011
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. And even
if it were updated, select_modify will not correctly remove the old handle
from the select() fdset, because the handle stored in ANFD->handle would be
I have no non-intrusive solution for it; the attached patch allows to work
around this problem by calling ev_fd_closed() immediately after closing the
socket. It makes libev remove the socket handle from the fdset and update
the handle associated with the FD.
Is there a better solution to this problem?
And if not, any chance that this patch could be landed?
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 2229 bytes
Desc: not available
More information about the libev