1
0
mirror of https://github.com/fafhrd91/actix-net synced 2025-01-31 09:12:08 +01:00

Merge branch 'master' of github.com:actix/actix-net

This commit is contained in:
Nikolay Kim 2019-12-03 14:09:35 +06:00
commit ec8dca8d69
2 changed files with 5 additions and 1 deletions

View File

@ -53,6 +53,7 @@ pub mod net {
pub use tokio::net::{UnixDatagram, UnixListener, UnixStream};
}
#[cfg(unix)]
pub use self::unix::*;
}

View File

@ -11,12 +11,15 @@ use crate::server::Server;
#[derive(PartialEq, Clone, Copy, Debug)]
pub(crate) enum Signal {
/// SIGHUP
#[cfg_attr(not(unix), allow(dead_code))]
Hup,
/// SIGINT
Int,
/// SIGTERM
#[cfg_attr(not(unix), allow(dead_code))]
Term,
/// SIGQUIT
#[cfg_attr(not(unix), allow(dead_code))]
Quit,
}
@ -69,7 +72,7 @@ impl Future for Signals {
#[cfg(not(unix))]
loop {
match Pin::new(&mut self.stream).poll_next(cx) {
Poll::Ready(Ok(Some(_))) => self.srv.signal(Signal::Int),
Poll::Ready(Some(_)) => self.srv.signal(Signal::Int),
Poll::Ready(None) => return Poll::Ready(()),
Poll::Pending => return Poll::Pending,
}