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

Question: socket.gethostname() functionality for this crate? #53

Closed
spamwax opened this issue Mar 16, 2020 · 4 comments
Closed

Question: socket.gethostname() functionality for this crate? #53

spamwax opened this issue Mar 16, 2020 · 4 comments

Comments

@spamwax
Copy link

spamwax commented Mar 16, 2020

I was just wondering if it makes sense to add a similar functionality to that of python's socket module to this crate so the hostname (FQDN or not) of the machine (for the local end of) socket is returned? or this is something beyond/unrelated to this crate?

@alexcrichton
Copy link
Member

Seems reasonable to me to add!

@spamwax
Copy link
Author

spamwax commented Mar 17, 2020

Thanks
I'd like to tackle this.

any hints/directions on design of the API is appreciated. For example, should we support gethostnmame() for all possible combination of Domain, Type and Protocol that socket2 offers or just focus on some?
(ex: does adgram type unix-domain socket need to have access to gethostname())

@Thomasdezeeuw
Copy link
Collaborator

@spamwax do you still need this? According to the manual glibc actually uses uname(2), so something like Nix might be a better crates for this, they already have a wrapper function: https://docs.rs/nix/0.19.1/nix/sys/utsname/fn.uname.html.

@spamwax
Copy link
Author

spamwax commented Dec 19, 2020

ok, thanks.

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

3 participants