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
overwritten. 

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?

- Bert

Attachment: 0001-Workaround-for-libev-handle-caching-bug-on-windows.patch
Description: Binary data

_______________________________________________
libev mailing list
[email protected]
http://lists.schmorp.de/cgi-bin/mailman/listinfo/libev

Reply via email to