eve.backend.windows.wpoll

Windows Layer 0 fallback backend built on WSAPoll.

This backend provides a simpler alternative to the IOCP backend for environments where WSAPoll is preferred or when IOCP is unavailable. It maintains a fixed-capacity registration table and translates poll events into the shared OsEvent shape consumed by Layer 1.

WSAPoll is limited to socket handles and cannot monitor arbitrary Windows handles such as files or pipes. For general-purpose handle monitoring, the IOCP backend should be used instead.

Types 3

Native event type returned by the wpoll backend.

Unlike epoll, WSAPoll does not produce a kernel-owned event payload, so the backend materializes a small translated record directly.

Fields
Handle handleHandle that became ready.
ulong userDataOpaque user value supplied at registration time.
IoReady readyShared readiness flags observed for the handle.
private structRegistration
Fields
SOCKET socket
IoInterest interest
ulong userData
bool active
structOsPoller

WSAPoll-backed poller state for Windows.

This backend maintains a registration table and uses WSAPoll for socket readiness detection. It provides simpler semantics than IOCP at the cost of being limited to socket handles.

Fields
private Registration[maxRegistrations] _registrations
private WSAPOLLFD[maxRegistrations] _pollFds
private size_t[maxRegistrations] _pollToReg
private size_t _registrationCount
private bool _valid
private bool _winsockInitialized
Methods
OsPoller create() @trusted nothrow @nogcCreate a new WSAPoll-based poller.
bool isValid() @property const pure @safe nothrow @nogcCheck whether the poller instance is still usable.
Handle handle() @property const pure @safe nothrow @nogcReturn the native handle wrapper for this poller.
int dispose() @safe nothrow @nogcDispose the poller and drop all registrations.
int registerHandle(Handle handle, IoInterest interest, ulong userData) @trusted nothrow @nogcRegister a handle with the given interests and opaque user data.
int modifyHandle(Handle handle, IoInterest interest, ulong userData) @trusted nothrow @nogcModify the interest mask and user data for an already-registered handle.
int unregisterHandle(Handle handle) @trusted nothrow @nogcRemove a handle from the registration table.
int wait(scope NativeEvent[] nativeEvents, int timeoutMs) @trusted nothrow @nogcWait for native events.
OsEvent translate(ref const(NativeEvent) nativeEvent) pure @safe nothrow @nogcTranslate a native wpoll event into the shared Layer 0 event shape.
IoReady translateReady(IoReady nativeReady) pure @safe nothrow @nogcTranslate native readiness into shared readiness flags.

Functions 2

private fnshort toNativeMask(IoInterest interest) pure @safe nothrow @nogc
private fnIoReady fromNativeMask(short mask) pure @safe nothrow @nogc

Variables 1

private enumvarmaxRegistrations = 1024