1
0
mirror of https://github.com/fafhrd91/actix-net synced 2025-08-23 21:05:12 +02:00

refactor server configuration and tls support

This commit is contained in:
Nikolay Kim
2019-12-02 11:30:27 +06:00
parent 16ff283fb2
commit 9fbe6a1f6d
21 changed files with 366 additions and 526 deletions

View File

@@ -23,9 +23,9 @@ pub(crate) enum Signal {
pub(crate) struct Signals {
srv: Server,
#[cfg(not(unix))]
stream: tokio_net::signal::CtrlC,
stream: actix_rt::signal::CtrlC,
#[cfg(unix)]
streams: Vec<(Signal, tokio_net::signal::unix::Signal)>,
streams: Vec<(Signal, actix_rt::signal::unix::Signal)>,
}
impl Signals {
@@ -33,13 +33,13 @@ impl Signals {
actix_rt::spawn({
#[cfg(not(unix))]
{
let stream = tokio_net::signal::ctrl_c()?;
let stream = actix_rt::signal::ctrl_c()?;
Signals { srv, stream }
}
#[cfg(unix)]
{
use tokio_net::signal::unix;
use actix_rt::signal::unix;
let mut streams = Vec::new();