Skip to content

Add Windows support #7

@dietmarkuehl

Description

@dietmarkuehl

Currently on POSIX systems using poll(2) are supported. To also support Windows a few things are needed:

  1. Windows doesn't use int to reference open files (I believe it uses HANDLE of some form). As the handle type leaks into interfaces at a few places it is abstracted away using native_handle_type and it needs to be suitably configured for different systems.
  2. The library is intended to never require allocations for its own needs. To facilitate that, it is necessary to store data needed by the system's I/O abstraction in an operation state for interfaces like Linux's io_uring or Window's IOCP. This information is intended to be stored in io_base (as there isn't a binding to io_uring it isn't clear whether it already contains sufficient members to accommodate that). For Windows the io_base would likely include (derive from) an WSAOVERLAPPED structure.
  3. To hook into the framework a class derived from context_base is needed. It should be possible to implement this using IOCP or using Window's BSD socket-like interface (although that might want to actually go into poll_context.

There is likely some conditional code needed, e.g., using suitable platform predefined macros.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions