Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Windows support #7

Open
dietmarkuehl opened this issue Sep 17, 2024 · 0 comments
Open

Add Windows support #7

dietmarkuehl opened this issue Sep 17, 2024 · 0 comments

Comments

@dietmarkuehl
Copy link
Collaborator

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant