-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
Expose a bind
method on UnixStream
#6288
Labels
A-tokio
Area: The main tokio crate
C-feature-request
Category: A feature request.
M-net
Module: tokio/net
Comments
little-dude
added
A-tokio
Area: The main tokio crate
C-feature-request
Category: A feature request.
labels
Jan 16, 2024
This is unlikely to be exposed as a |
I'm interested in this, but don't have a ton of experience working with Unix sockets - I wonder if it makes sense to create a |
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.
M-net
Module: tokio/net
Is your feature request related to a problem? Please describe.
Although very unconventional, it may be useful to bind a unix socket to a specific path. In my case, the listener calls
UnixStream::peer_addr()
upon accepting an incoming connection, and the path contains information necessary to process the connection.Describe the solution you'd like
Allow users to create a
UnixStream
bound to a specific path.socket2
exposes abind
for this. I'm not sure how to make this fully backward compatible in tokio case though, sinceUnixStream::connect
is currently the only way to create a socket.Describe alternatives you've considered
AsyncFd
for the connection, then convert the socket into a tokio socketconnect
call, then convert the socket into a tokio socketThe text was updated successfully, but these errors were encountered: