1
0
mirror of https://github.com/fafhrd91/actix-net synced 2025-06-28 23:30:36 +02:00

add unix domain sockets support

This commit is contained in:
Nikolay Kim
2019-07-18 16:43:42 +06:00
parent 9d1b428b34
commit 2955e49d78
3 changed files with 37 additions and 3 deletions

View File

@ -95,9 +95,9 @@ impl<T, P> Io<T, P> {
/// Return new Io object with new parameter.
pub fn set<U>(self, params: U) -> Io<T, U> {
Io {
params,
io: self.io,
proto: self.proto,
params: params,
}
}
@ -216,3 +216,26 @@ impl<T: IoStream> IoStream for tokio_rustls::TlsStream<T, rustls::ServerSession>
self.get_mut().0.set_keepalive(dur)
}
}
#[cfg(all(unix, feature = "uds"))]
impl IoStream for tokio_uds::UnixStream {
#[inline]
fn peer_addr(&self) -> Option<net::SocketAddr> {
None
}
#[inline]
fn set_nodelay(&mut self, _: bool) -> io::Result<()> {
Ok(())
}
#[inline]
fn set_linger(&mut self, _: Option<time::Duration>) -> io::Result<()> {
Ok(())
}
#[inline]
fn set_keepalive(&mut self, _: Option<time::Duration>) -> io::Result<()> {
Ok(())
}
}