feat(server): implement AsRawFd for AddrStream (#2246)

Fixes #2245.
This commit is contained in:
Theodore DeRego
2020-07-16 08:26:46 -07:00
committed by GitHub
parent 4216b2de70
commit b5d5e21449

View File

@@ -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;
@@ -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()
}
}
}