Skip to content

Commit

Permalink
Merge pull request #941 from theo3/fix-tcp-vecio
Browse files Browse the repository at this point in the history
Fix vectored IO for TcpStream
  • Loading branch information
dignifiedquire authored Jan 20, 2021
2 parents 6278fdc + a46464d commit af66efe
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions src/net/tcp/stream.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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)
}
Expand Down

0 comments on commit af66efe

Please sign in to comment.