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

Match the standard library's interface for unix sockets on unix. #403

Merged
merged 17 commits into from
Mar 4, 2023

Conversation

t4lz
Copy link
Contributor

@t4lz t4lz commented Feb 27, 2023

Following #332, currently unix only. Should this interface also be made available on Windows?

This PR adds to SockAddr methods to get the path of the unix socket address on unix.
It also adds the new methods to the tests.

to enable determining what type of AF_UNIX address it is, if any.
Enable retrieving the pathname or abstract address of the socket,
if applicable.
Also, fix some typos in CONTRIBUTING.
src/sys/unix.rs Outdated Show resolved Hide resolved
src/sockaddr.rs Outdated Show resolved Hide resolved
src/sys/unix.rs Show resolved Hide resolved
src/sys/unix.rs Outdated Show resolved Hide resolved
src/sys/unix.rs Show resolved Hide resolved
src/sys/unix.rs Outdated Show resolved Hide resolved
tests/socket.rs Outdated Show resolved Hide resolved
src/sys/unix.rs Outdated Show resolved Hide resolved
src/sys/unix.rs Show resolved Hide resolved
src/sys/unix.rs Outdated Show resolved Hide resolved
t4lz and others added 2 commits March 1, 2023 17:35
Co-authored-by: Thomas de Zeeuw <thomasdezeeuw@gmail.com>
Copy link
Collaborator

@Thomasdezeeuw Thomasdezeeuw left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Only question is Fuchsia, we might have to remove it for now (sorry for suggesting it in the first place).

Copy link
Collaborator

@Thomasdezeeuw Thomasdezeeuw left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One final suggestion based on @tamird and @ghanan94's feedback.

src/sys/unix.rs Outdated Show resolved Hide resolved
src/sys/unix.rs Outdated Show resolved Hide resolved
tests/socket.rs Outdated Show resolved Hide resolved
src/sys/unix.rs Outdated Show resolved Hide resolved
t4lz and others added 3 commits March 3, 2023 18:10
Co-authored-by: Thomas de Zeeuw <thomasdezeeuw@gmail.com>
@Thomasdezeeuw Thomasdezeeuw merged commit 26ad768 into rust-lang:master Mar 4, 2023
@Thomasdezeeuw
Copy link
Collaborator

Thanks @t4lz!

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

Successfully merging this pull request may close these issues.

None yet

5 participants