Skip to content

Commit

Permalink
impl AsRawFd for AddrStream. Fixes #2245.
Browse files Browse the repository at this point in the history
  • Loading branch information
tedsta committed Jul 16, 2020
1 parent 4216b2d commit 62b18ea
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/server/tcp.rs
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,8 @@ mod addr_stream {
use bytes::{Buf, BufMut};
use std::io;
use std::net::SocketAddr;
#[cfg(unix)]
use std::os::unix::io::{AsRawFd, RawFd};
use tokio::io::{AsyncRead, AsyncWrite};
use tokio::net::TcpStream;

Expand Down Expand Up @@ -288,4 +290,11 @@ mod addr_stream {
Pin::new(&mut self.inner).poll_shutdown(cx)
}
}

#[cfg(unix)]
impl AsRawFd for AddrStream {
fn as_raw_fd(&self) -> RawFd {
self.inner.as_raw_fd()
}
}
}

0 comments on commit 62b18ea

Please sign in to comment.