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 UDS Support #2201

Open
mattsre opened this issue Jan 30, 2020 · 19 comments
Open

Windows UDS Support #2201

mattsre opened this issue Jan 30, 2020 · 19 comments
Labels
A-tokio Area: The main tokio crate C-feature-request Category: A feature request. E-help-wanted Call for participation: Help is requested to fix this issue. M-net Module: tokio/net

Comments

@mattsre
Copy link

mattsre commented Jan 30, 2020

Version

Tokio version - 0.2.11

Platform

Windows 10 Pro - 1909 (November Update)

Description

I'd like to be able to use UDS on Windows with Tokio. Windows 10 introduced support for unix sockets in late 2017 to Insiders builds, and the spring 2018 general Windows 10 release. Building this functionality into Tokio allows downstream ecosystems, such as Tonic's, to use this support to enhance their own offerings and examples.

Windows UDS Support: https://devblogs.microsoft.com/commandline/af_unix-comes-to-windows/
Tonic reference issue: hyperium/tonic#238

@lucasyvas
Copy link

Looks like the folks at Azure took a run at this, but it's likely an out of date solution now:

https://github.com/Azure/tokio-uds-windows

@Darksonn Darksonn added A-tokio Area: The main tokio crate C-feature-request Category: A feature request. M-net Module: tokio/net E-help-wanted Call for participation: Help is requested to fix this issue. labels Jul 25, 2020
@Darksonn
Copy link
Contributor

This seems like it should be added to mio first.

@carllerche
Copy link
Member

Because we hid PollEvented, this is going to need some additional support. I don't know much about UDS on windows. Will it work w/ AFD (see how tcp/udp are now implemented on windows)? or does it need to go via IOCP?

@johnspurlock
Copy link

Just curious if there was any update on when/if this could happen. Seems to be blocking denoland/deno#10750 over in Deno land, which I'm eagerly watching...

@Noah-Kennedy
Copy link
Contributor

Noah-Kennedy commented Oct 10, 2021

I'm interested in this as well. I'll muck about with this and see what I can come up with. This would have to start with mio, as has already been mentioned.

@Darksonn
Copy link
Contributor

We don't currently have any plans to work on this feature, but if someone wants to figure out how it works and implement it, I would be happy to review such a PR.

@elmarco
Copy link

elmarco commented Feb 2, 2022

afaik, it will require changes in mio, which in turns needs std support. This might take a while. see rust-lang/rust#56533

@Darksonn
Copy link
Contributor

Darksonn commented Feb 3, 2022

Well, we managed to add named pipes on windows without std support.

@Noah-Kennedy
Copy link
Contributor

I'm actually working on this right now.

@msabansal
Copy link

@Noah-Kennedy any updates on this? Are you still working on it?

@Noah-Kennedy
Copy link
Contributor

I will get back to this and finish it soon.

@Hobbit44
Copy link

Hobbit44 commented Jun 2, 2022

@Noah-Kennedy Any news? Im really looking forward to some downstream uses of this.

@Noah-Kennedy
Copy link
Contributor

I have still not gotten around to this unfortunately.

@sullivan-sean
Copy link

sullivan-sean commented Aug 16, 2022

I have a PR for mio support here tokio-rs/mio#1610 and if that is upstreamed it should be pretty easy to add to tokio.

I have a first pass here https://github.com/sullivan-sean/tokio built on the above PR to mio that seems to be working. It could definitely be cleaned up a bit (lots of code reuse between unix and windows) but I've been able to use this in cross-platform projects already

@KolbyML
Copy link

KolbyML commented May 4, 2023

sullivan-sean stopped work on his PR so I decided to picked up the torch.

Here is the current tokio-rs/mio#1667 PR it addresses most if not all of the concerns outlined with the original PR. I will support the PR as long as it takes, After that I will look into making a PR for tokio

@tensor-programming
Copy link

tensor-programming commented May 25, 2023

@KolbyML do you need any help here? I was working on an independent implementation for ockam's uds library. I basically just ripped parts out of the azure repos and rewrote them to mirror Mio and Tokio's Unix implementations. The issue I ran into though, is that Tokio no longer exposes the PollEvented type; I could have tried to use something like tokio-reactor but that didn't seem like an elegant solution.

I'd like to help give a shot in the arm, so that we can get this into Tokio and Mio. I can start in on the Tokio version since the Mio PR seems finished. Or is there something else holding this up?

@KolbyML
Copy link

KolbyML commented May 26, 2023

Hi @tensor-programming I believe I resolved Thomasdezeeuw concerns with the original PR. I think the main thing now is community interest maybe? Also since it is a relatively big PR it might take sometime before core maintainers have time to review it.

So far I haven't heard any push back from core maintainers of Tokio, but I also haven't seen much interest in it yet as well. So I hope in the future we do get the support we need. I did try to shoot a message to Thomasdezeeuw 3 weeks ago, if he had interest in reviewing it in the next few months or if there were some kind of hard blocker and I haven't heard back on that yet.

Mio also has a very slow release schedule. So first a release would need to be made then Tokio would have to update so it seems to me like a long play. After that release was made I think it would then be the opportunity to work on it for Tokio.

So who knows hopefully the message you sent lights a spark! 🎇 I will be waiting patiently and hoping for the best since I think getting support for this would be fantastic!

@localhosted
Copy link

I can't build Deno on Windows because of this error: cannot find type 'UnixStream' in module 'tokio::net, afaik adding UDS should make it possible to build tokio?

@tensor-programming
Copy link

tensor-programming commented Jul 3, 2023

No problem, I understand. Just lending my time if it was needed. I just noticed that things seemed like they had stalled. Seems I was wrong in that assumption. Fell of the map anyhow for a couple of months due to personal reasons. Ill keep an eye on the progress here in the meantime.

zeenix added a commit to zeenix/zbus that referenced this issue Feb 11, 2024
Since tokio currently [does not support Unix domain sockets on
Windows][tuds], there is no reason to enable UDS support on Windows+tokio.
This also fixes a build warning against rust nightly:

```rust
error: field `0` is never read
  --> zbus\src\connection\builder.rs:45:16
   |
45 |     UnixStream(UnixStream),
   |     ---------- ^^^^^^^^^^
   |     |
   |     field in this variant
   |
   = note: `-D dead-code` implied by `-D warnings`
   = help: to override `-D warnings` add `#[allow(dead_code)]`
help: consider changing the field to be of unit type to suppress this warning while preserving the field numbering, or remove the field
   |
45 |     UnixStream(()),
   |                ~~
```

[tuds]: tokio-rs/tokio#2201
zeenix added a commit to zeenix/zbus that referenced this issue Feb 11, 2024
Since tokio currently [does not support Unix domain sockets on
Windows][tuds], there is no reason to enable UDS support on Windows+tokio.
This also fixes a build warning against rust nightly:

```rust
error: field `0` is never read
  --> zbus\src\connection\builder.rs:45:16
   |
45 |     UnixStream(UnixStream),
   |     ---------- ^^^^^^^^^^
   |     |
   |     field in this variant
   |
   = note: `-D dead-code` implied by `-D warnings`
   = help: to override `-D warnings` add `#[allow(dead_code)]`
help: consider changing the field to be of unit type to suppress this warning while preserving the field numbering, or remove the field
   |
45 |     UnixStream(()),
   |                ~~
```

[tuds]: tokio-rs/tokio#2201
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-tokio Area: The main tokio crate C-feature-request Category: A feature request. E-help-wanted Call for participation: Help is requested to fix this issue. M-net Module: tokio/net
Projects
None yet
Development

No branches or pull requests