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

zero-copy supports #2438

Closed
Future2100 opened this issue Apr 24, 2020 · 3 comments
Closed

zero-copy supports #2438

Future2100 opened this issue Apr 24, 2020 · 3 comments
Labels
A-tokio Area: The main tokio crate C-feature-request Category: A feature request. M-net Module: tokio/net

Comments

@Future2100
Copy link

Is there possible to support zero-copy for the network socket?

@Darksonn Darksonn added A-tokio Area: The main tokio crate C-question User questions that are neither feature requests nor bug reports M-net Module: tokio/net labels Apr 24, 2020
@Darksonn
Copy link
Contributor

Can you specify which copy you're asking if it is possible to avoid?

@Future2100
Copy link
Author

@Darksonn I want a zero-copy(such as Linux API splice) between two sockets.
Here is a link reference: https://lwn.net/Articles/726917/

@Matthias247
Copy link
Contributor

This isn't possible with the current set of APIs Tokio provides. These will copy all data to/from userspace buffers. Zero copy APIs are challenging, because they require the buffer to be alive for the whole duration of an async operation. However Rusts async tasks can be cancelled at any point in time.

There might be future support for this through io_uring APIs that people are thinking about, but this is currently only in the concept phase.

@Darksonn Darksonn added C-feature-request Category: A feature request. and removed C-question User questions that are neither feature requests nor bug reports labels Apr 29, 2020
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

No branches or pull requests

3 participants