-
-
Notifications
You must be signed in to change notification settings - Fork 14.3k
UnixStream/UnixListener on Windows #150428
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
base: main
Are you sure you want to change the base?
Conversation
This comment has been minimized.
This comment has been minimized.
|
r? libs |
|
No reviewers could be found from initial request |
|
@dtolnay Could you check this pr too? |
|
Reminder, once the PR becomes ready for a review, use |
|
@rustbot ready |
|
Let's try to re-roll again r? libs |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please also keep commits squashed as you go.
| use crate::{fmt, io, mem}; | ||
|
|
||
| #[cfg(not(doc))] | ||
| pub fn sockaddr_un(path: &Path) -> io::Result<(SOCKADDR_UN, usize)> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reading https://devblogs.microsoft.com/commandline/af_unix-comes-to-windows/, it looks to me like abstract and unnamed sockets should both be supported by Windows as well. Presumably the implementation should as such more closely mirror library/std/src/os/unix/net/addr.rs?
That would also fix the problem in fmt::Debug, where you bail if it's not a path socket incorrectly; it would make more sense for me if it used the same strategy as the unix impl.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe abstract sockets not support by Windows. Set first byte of sun_path to zero cause code: 10022 when connect
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you add an unresolved question to the tracking issue about that? It doesn't seem expected to me given:
The second category is the ‘abstract’ socket address where the first character in ‘sun_path’ is a null byte. Windows implementation of AF_UNIX socket can also accept abstract addresses. The one difference noteworthy here is that the Windows unix socket implementation currently does not support the autobind feature whereby an abstract address is auto-generated by the implementation on behalf of the user.
Maybe something is wrong with our setup or the blog post is stale...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Mark-Simulacrum seems like microsoft not impl full AF_UNIX yet. I will add this ref to tracking issue.
I suggest specifying in the documentation that only AF_UNIX SOCK_STREAM with TRUE paths is supported
|
@rustbot ready |
Hi, I re impl this. Hope you test it.
Document build and tests are successful on my Arch Linux.