mirror of
https://github.com/fafhrd91/actix-net
synced 2025-06-27 06:09:02 +02:00
refactor server configuration and tls support
This commit is contained in:
@ -32,6 +32,28 @@ where
|
||||
Arbiter::spawn(f);
|
||||
}
|
||||
|
||||
/// Asynchronous signal handling
|
||||
pub mod signal {
|
||||
#[cfg(unix)]
|
||||
pub mod unix {
|
||||
pub use tokio_net::signal::unix::*;
|
||||
}
|
||||
pub use tokio_net::signal::{ctrl_c, CtrlC};
|
||||
}
|
||||
|
||||
/// TCP/UDP/Unix bindings
|
||||
pub mod net {
|
||||
pub use tokio::net::UdpSocket;
|
||||
pub use tokio::net::{TcpListener, TcpStream};
|
||||
|
||||
#[cfg(unix)]
|
||||
mod unix {
|
||||
pub use tokio::net::{UnixDatagram, UnixListener, UnixStream};
|
||||
}
|
||||
|
||||
pub use self::unix::*;
|
||||
}
|
||||
|
||||
/// Utilities for tracking time.
|
||||
pub mod time {
|
||||
use std::time::{Duration, Instant};
|
||||
@ -52,15 +74,3 @@ pub mod time {
|
||||
Interval::new(start, duration)
|
||||
}
|
||||
}
|
||||
|
||||
pub mod net {
|
||||
pub use tokio::net::UdpSocket;
|
||||
pub use tokio::net::{TcpListener, TcpStream};
|
||||
|
||||
#[cfg(unix)]
|
||||
mod unix {
|
||||
pub use tokio::net::{UnixDatagram, UnixListener, UnixStream};
|
||||
}
|
||||
|
||||
pub use self::unix::*;
|
||||
}
|
||||
|
Reference in New Issue
Block a user