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

Windows support #7

Open
sanmai-NL opened this issue Feb 13, 2018 · 7 comments
Open

Windows support #7

sanmai-NL opened this issue Feb 13, 2018 · 7 comments

Comments

@sanmai-NL
Copy link

This is to track implementation status for Windows. This will become feasible.

https://blogs.msdn.microsoft.com/commandline/2017/12/19/af_unix-comes-to-windows/

@myagley
Copy link

myagley commented Aug 10, 2018

Hi. I work for Microsoft on IoT Edge. We are interested in adding support for unix domain sockets on Windows. They are available now on RS4 (17134), with improvements coming in RS5 in the fall timeframe.

We ultimately need support in tokio-uds on IoT Edge and support in mio-uds seems like the first step. How should we proceed? Is this something you are interested in?

I don't think rust cfg attributes can detect the version of windows, so we may need to use a feature?

Thanks!

@alexcrichton
Copy link
Contributor

@myagley oh wow! Right now this crate doesn't work at all on Windows so adding support, even if it requires a super-new version, should be fine to add at any time I think! We can always work later about having it work "better" on older platforms (for whatever "better" means at the time)

@arsing
Copy link

arsing commented Mar 11, 2019

@damonbarry made https://github.com/Azure/mio-uds-windows which is what we use in Azure/iotedge.

It's not directly pullable as a PR in its current state, since it replaces mio-uds rather than live inside it (we select between the two based on target cfg). So we need to work on making it a cfg(windows) submodule first.

Edit: I've begun integrating it into https://github.com/arsing/mio-uds/tree/windows

@arsing
Copy link

arsing commented Mar 14, 2019

@alexcrichton

I've updated the branch in my previous comment with a skeleton of the change. It separates the platform-specific parts into a sys module, and has implementations for Linux (the original code) and stubs for Windows. The Evented impls of the Windows UnixListener and UnixStream are unimplemented, as are the scatter-gather IO functions read_bufs and write_bufs.

The difficulty here is that a lot of the API needed to implement those is private:

  • The Windows-specific Socket type in libstd is not exposed, so it needs to reimplement it.

  • The Evented impls for UnixListener and UnixStream need to use the system selector like mio'sTcpListener and TcpStream do, but the relevant types around buffer handling and stable overlapped pointers are not exposed.

This is why the repo we use for Azure/iotedge duplicates large parts of libstd and mio, including transmuting mio structs to identically defined structs in that crate in some places. This works for Azure/iotedge's use case, but it's obviously not something that we want to upstream.

Do you have any ideas how to proceed?

@alexcrichton
Copy link
Contributor

Ah unfortunately I don't have a ton of time to maintain this crate any more so I may not be much of a help :(

If it'd help though I'd be up for transferring this crate to a new owner!

@arsing
Copy link

arsing commented Mar 15, 2019

I'll investigate if it's possible to abstract out the TCP specific parts of mio's TcpListener (looking up the address family, creating a new socket in accept(), etc) out to make a generic mio::windows::net::SocketListener and then make that public. cc @carllerche for your thoughts.

Edit: WIP mio change here.

@carllerche
Copy link

Given the inclusion of uds as part of Rust std, I think it could make sense to add uds support to mio proper. We probably want to target 0.7.

darosior added a commit to revault/revaultd that referenced this issue Nov 17, 2020
I could not find a way to get mio 0.7 running with Windows' uds. So,
until tokio-rs/mio#880 (deprecrated/mio-uds#7)
is implemented in Mio we use a simple blocking event loop for Windows.

That's fine, it's just for the RPC. We could potentially see some load
on a server, but it'd be on UNIX so Everything Is Fine ™️.

Signed-off-by: Antoine Poinsot <darosior@protonmail.com>
darosior added a commit to revault/revaultd that referenced this issue Nov 18, 2020
I could not find a way to get mio 0.7 running with Windows' uds. So,
until tokio-rs/mio#880 (deprecrated/mio-uds#7)
is implemented in Mio we use a simple blocking event loop for Windows.

That's fine, it's just for the RPC. We could potentially see some load
on a server, but it'd be on UNIX so Everything Is Fine ™️.

Signed-off-by: Antoine Poinsot <darosior@protonmail.com>
darosior added a commit to revault/revaultd that referenced this issue Nov 18, 2020
I could not find a way to get mio 0.7 running with Windows' uds. So,
until tokio-rs/mio#880 (deprecrated/mio-uds#7)
is implemented in Mio we use a simple blocking event loop for Windows.

That's fine, it's just for the RPC. We could potentially see some load
on a server, but it'd be on UNIX so Everything Is Fine ™️.

Signed-off-by: Antoine Poinsot <darosior@protonmail.com>
darosior added a commit to revault/revaultd that referenced this issue Nov 19, 2020
I could not find a way to get mio 0.7 running with Windows' uds. So,
until tokio-rs/mio#880 (deprecrated/mio-uds#7)
is implemented in Mio we use a simple blocking event loop for Windows.

That's fine, it's just for the RPC. We could potentially see some load
on a server, but it'd be on UNIX so Everything Is Fine ™️.

Signed-off-by: Antoine Poinsot <darosior@protonmail.com>
darosior added a commit to revault/revaultd that referenced this issue Nov 19, 2020
I could not find a way to get mio 0.7 running with Windows' uds. So,
until tokio-rs/mio#880 (deprecrated/mio-uds#7)
is implemented in Mio we use a simple blocking event loop for Windows.

That's fine, it's just for the RPC. We could potentially see some load
on a server, but it'd be on UNIX so Everything Is Fine ™️.

Signed-off-by: Antoine Poinsot <darosior@protonmail.com>
darosior added a commit to revault/revaultd that referenced this issue Nov 21, 2020
I could not find a way to get mio 0.7 running with Windows' uds. So,
until tokio-rs/mio#880 (deprecrated/mio-uds#7)
is implemented in Mio we use a simple blocking event loop for Windows.

That's fine, it's just for the RPC. We could potentially see some load
on a server, but it'd be on UNIX so Everything Is Fine ™️.

Signed-off-by: Antoine Poinsot <darosior@protonmail.com>
darosior added a commit to revault/revaultd that referenced this issue Nov 21, 2020
I could not find a way to get mio 0.7 running with Windows' uds. So,
until tokio-rs/mio#880 (deprecrated/mio-uds#7)
is implemented in Mio we use a simple blocking event loop for Windows.

That's fine, it's just for the RPC. We could potentially see some load
on a server, but it'd be on UNIX so Everything Is Fine ™️.

Signed-off-by: Antoine Poinsot <darosior@protonmail.com>
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

5 participants