2
0
Fork 1
mirror of https://github.com/async-rs/async-std.git synced 2025-04-02 14:36:40 +00:00

Merge pull request #941 from theo3/fix-tcp-vecio

Fix vectored IO for TcpStream
This commit is contained in:
Friedel Ziegelmayer 2021-01-20 16:11:16 +01:00 committed by GitHub
commit af66efe540
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -307,6 +307,14 @@ impl Read for &TcpStream {
) -> Poll<io::Result<usize>> {
Pin::new(&mut &*self.watcher).poll_read(cx, buf)
}
fn poll_read_vectored(
self: Pin<&mut Self>,
cx: &mut Context<'_>,
bufs: &mut [IoSliceMut<'_>],
) -> Poll<io::Result<usize>> {
Pin::new(&mut &*self.watcher).poll_read_vectored(cx, bufs)
}
}
impl Write for TcpStream {
@ -344,6 +352,14 @@ impl Write for &TcpStream {
Pin::new(&mut &*self.watcher).poll_write(cx, buf)
}
fn poll_write_vectored(
self: Pin<&mut Self>,
cx: &mut Context<'_>,
bufs: &[IoSlice<'_>],
) -> Poll<io::Result<usize>> {
Pin::new(&mut &*self.watcher).poll_write_vectored(cx, bufs)
}
fn poll_flush(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<io::Result<()>> {
Pin::new(&mut &*self.watcher).poll_flush(cx)
}