Better Windows backend using wepoll?

Marc Lehmann schmorp at
Sat Jun 2 16:14:55 CEST 2018

On Thu, May 31, 2018 at 07:55:13PM +0800, Linus Yang <laokongzi at> wrote:
> Libev has relatively weaker support on Windows than other Unix-like
> platforms (Linux, BSD and macOS) due to the complexity of IOCP event
> model.

Well, it's not weaker when it supports the same interface on windows.

The problem libev ran into was that IOCPs only work with some sockets, not
all sockets, and do not portably support event notifications. If this has
somehow been solved (or was only a problem on obsolete windows platforms)
this could be changed.

Or, rather, if the wepoll API is reasonably similar to epoll, one could
indeed recompile libev with epoll as backend, probably with miniscule

> I tried to port shadowsocks-libev [2] to MinGW using wepoll. The libev
> library only needs very few changes [3] to use wepoll as backend. We
> currently maintain a local fork of libev and prefer if such change
> could go upstream.
> Do you have any interest or opinions on integrating the wepoll library
> inside libev for better Windows support?

Since the wepoll licenses is more restrictive, it cannot be integrated,
but it should not be an issue to support wepoll as another backend,
especially since it seems to closely emulate the epoll API.

Another option would be to find out how wepoll works around the existing
problems with IOCPs only supporting a subset of sockets (if it does) and
change the windows backend in libev to use the same method, especially if
it seems simple.

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

More information about the libev mailing list