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

Support peeking on unix sockets #3946

Open
lucacasonato opened this issue Jul 8, 2021 · 0 comments
Open

Support peeking on unix sockets #3946

lucacasonato opened this issue Jul 8, 2021 · 0 comments
Labels
A-tokio Area: The main tokio crate C-feature-request Category: A feature request.

Comments

@lucacasonato
Copy link

lucacasonato commented Jul 8, 2021

Is your feature request related to a problem?

Tokio gives the user the ability to peek at data on a TCP socket using TcpStream::peek (same on the split half). Under the hood this calls recv(2) with the MSG_PEEK flag set. This feature is not available for unix sockets, even they support this feature too AFAIK.

Describe the solution you'd like

UnixStream::peek that behaves the same way as TcpStream::peek.

Describe alternatives you've considered

UnixStream::read with a temporary buffer. This is not as versatile or as easy to use though.

Additional info

This will need support in mio: tokio-rs/mio#1418

@lucacasonato lucacasonato added A-tokio Area: The main tokio crate C-feature-request Category: A feature request. labels Jul 8, 2021
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.
Projects
None yet
Development

No branches or pull requests

1 participant