Skip to content

Yet another implementation of epoll on Windows, in Rust. Based on `ProcessSocketNotifications` and `NtAssociateWaitCompletionPacket`.

License

Notifications You must be signed in to change notification settings

Berrysoft/wepoll2

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

24 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

wepoll2

This is a Rust crate inspired by the famous wepoll library. It provides similar FFI, but not ABI-compatible.

Previously I tried to add ProcessSocketNotifications backend for polling, but it doesn't fit that crate well.

Implementation details

The crate is no-std by default to reduce the binary size. All APIs are panic-free.

Unlike wepoll, ProcessSocketNotifications is used in this library. It behaves a little different from epoll in Linux.

wepoll2 supports event objects with NtAssociateWaitCompletionPacket API series. No thread pool involved, and one-shot trigger only.

Extensions

epoll_pwait and epoll_pwait2 is implemented for alertable waiting and timespec support.

Limitations

  • ProcessSocketNotifications is a very new API.
  • The edge trigger behaves a little different.
  • One socket could be only associated to one IOCP.
  • Not all EPOLL* flags are supported.

Bugs

  • Sockets don't work on i686 target. Still investigating.
  • epoll_wait series API may wait for a shorter time than specified. Maybe bugs of Windows API.

About

Yet another implementation of epoll on Windows, in Rust. Based on `ProcessSocketNotifications` and `NtAssociateWaitCompletionPacket`.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published