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 for anonymous pipes #5547

Closed
notpeelz opened this issue Mar 15, 2023 · 2 comments · Fixed by #6127
Closed

Support for anonymous pipes #5547

notpeelz opened this issue Mar 15, 2023 · 2 comments · Fixed by #6127
Labels
A-tokio Area: The main tokio crate C-feature-request Category: A feature request. M-net Module: tokio/net

Comments

@notpeelz
Copy link

notpeelz commented Mar 15, 2023

Is your feature request related to a problem? Please describe.
It's unclear how anonymous pipes should be used in Tokio. For my use case, I have a RawFd returned from a pipe2() syscall and I want to wrap it with the types in tokio::net::unix::pipe. At the moment, it seems like the only way to do this is to wrap it in a File first:

let file = unsafe { std::fs::File::from_raw_fd(fd) };
let sender = tokio::net::unix::pipe::Sender::from_file(file).unwrap();

Describe the solution you'd like
I'm not sure if wrapping it in a File is the "right" way to do this, but it should at least be documented.

@notpeelz notpeelz added A-tokio Area: The main tokio crate C-feature-request Category: A feature request. labels Mar 15, 2023
@Darksonn Darksonn added the M-net Module: tokio/net label Mar 15, 2023
@Darksonn
Copy link
Contributor

We should definitely have a way to construct an anonymous pipe in the API.

@luben
Copy link
Contributor

luben commented Mar 15, 2023

I found https://crates.io/crates/tokio-pipe works well for my use case. Having it in tokio would be better of course.

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
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants