We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
When write_vectored is used on a DuplexStream it only writes the first buffer in the scatter/gather list.
write_vectored
DuplexStream
It would be nice if it wrote as much as it can.
The following code illustrates the problem:
use std::io::IoSlice; use bytes::Bytes; use tokio::io::AsyncWriteExt; #[tokio::main] async fn main() { let bufs = vec![Bytes::from("hello,"), Bytes::from(" world")]; let (mut ep1, _ep2) = tokio::io::duplex(64*1024); let iov: Vec<IoSlice> = bufs.iter().map(|b| IoSlice::new(b)).collect(); println!("iov.len={}", iov.len()); let total_size = iov.iter().fold(0, |acc, e| acc + e.len()); println!("total size: {}", total_size); let written = ep1.write_vectored(&iov[..]).await.unwrap(); println!("wrote {} bytes", written) }
The program outputs that it has written 6 bytes, rather than the expected 12.
The text was updated successfully, but these errors were encountered:
No branches or pull requests
When
write_vectored
is used on aDuplexStream
it only writes the first buffer in the scatter/gather list.It would be nice if it wrote as much as it can.
The following code illustrates the problem:
The program outputs that it has written 6 bytes, rather than the expected 12.
The text was updated successfully, but these errors were encountered: