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
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: