-
Notifications
You must be signed in to change notification settings - Fork 13.3k
Make the unix::net::SocketAddr
creation methods public
#65255
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
Make the unix::net::SocketAddr
creation methods public
#65255
Conversation
Signed-off-by: Kevin Leimkuhler <kleimkuhler@icloud.com>
(rust_highfive has picked a reviewer for you, use r? to override) |
The job Click to expand the log.
I'm a bot! I can only do what humans tell me to, so if this was not helpful or you have suggestions for improvements, please ping or otherwise contact |
These need |
Hmm, in their current state I don’t think the It looks like we do have some examples of defining So I think we’ll need to sketch out a more suitable public API for constructing |
Why can't mio just use the standard library's UnixListener? https://doc.rust-lang.org/std/os/unix/net/struct.UnixListener.html |
@sfackler It is mainly because |
@KodrAus That is a good point. I found the signatures a little surprising when first looking at them. If exposing |
@kleimkuhler that sounds like a good plan me to! Maybe we can also look at whether it’s feasible for |
@KodrAus So it's not just This ultimately is because the sockets need this additional flag set as part of the socket creation instead of a separate call to Closing this PR per discussion above and further conversation can take place in #65275. |
Motivation
Recently tokio-rs/mio needed support for creating the
std::os::unix::net::SocketAddr
type. While the type is currently public, it isnot possible to create one as both creation methods are private:
The workaround was creating a
mio
specificSocketAddr
that is equivalent tothis type.
A use of needing
SocketAddr::from_parts
is shown here.Details
This PR makes the creation methods public so that the already public type can be
created as well. Comments with examples have been added.
I did not feel an RFC process was needed for this; I hope that assumtion is
correct!
Signed-off-by: Kevin Leimkuhler kleimkuhler@icloud.com