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

Support UnixStream on Windows #1609

Open
sullivan-sean opened this issue Aug 16, 2022 · 7 comments
Open

Support UnixStream on Windows #1609

sullivan-sean opened this issue Aug 16, 2022 · 7 comments
Labels
windows Related to the Windows OS.

Comments

@sullivan-sean
Copy link

Windows 10 added support for unix sockets in a 2018 general Windows 10 release. Building this functionality into Mio would allow support in Tokio and other downstream libs.

This seems to be of interest in several downstream libs, example issues here:

Mio's current AFD approach on Windows actually seems to be compatible with AF_UNIX sockets (noted e.g. in this wepoll issue).

@sullivan-sean
Copy link
Author

sullivan-sean commented Aug 16, 2022

With some tinkering I've put together a first pass here that uses the existing AFD approach and passes all of the corresponding unix unix_stream and unix_listener tests in mio.

There are a few tweaks that need to be made, e.g. right now the selector must be re-registered between events which I think quirk may be related to how user_evt flags are not fully reset on the selector after an event:

// In mio, we have to simulate Edge-triggered behavior to match API usage.
// The strategy here is to intercept all read/write from user that could cause WouldBlock usage,
// then reregister the socket to reset the interests.
self.user_evts &= !afd_events;

Another question is where the windows analog of std::os::unix::net should live, given that UDS is not in std yet

For now I have included a module directly within the repo modeled after https://crates.io/crates/uds_windows using windows-sys instead of winapi. But I hope there is a better way to do this

@dojyorin
Copy link

Hi😀

I want to implement an IPC mechanism in an application using Windows version of Deno.

Currently, Deno UDS is a trial support only for the Linux version, but I hope that it will eventually support the Windows version.

And I'm very interested in implementing this feature upstream of Deno.

Thanks for development😄

@Noah-Kennedy
Copy link

There is a PR right now open for this. It hasn't been updated in several weeks though. Not sure if stalled or just going slowly.

@keithmattix
Copy link

Looks like the PRs in question have stalled....is anyone looking at this recently?

@Darksonn
Copy link
Contributor

Nobody is looking at it right now.

@Noah-Kennedy
Copy link

@keithmattix if you want to have a go at this please feel free to do so!

@juliusl
Copy link

juliusl commented Oct 3, 2024

Update: The API Change Proposal was just accepted. So now we do just need the implementation.

I'm interested in this feature and looks like upstream std lib has some progress made

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

No branches or pull requests

7 participants