21 lines
501 B
Rust
21 lines
501 B
Rust
use tokio::sync::watch;
|
|
|
|
use ptth_quic::prelude::*;
|
|
use ptth_quic::executable_end_server as server;
|
|
|
|
#[tokio::main]
|
|
async fn main () -> anyhow::Result <()> {
|
|
tracing_subscriber::fmt::init ();
|
|
|
|
let args: Vec <_> = std::env::args_os ().collect ();
|
|
|
|
let (shutdown_tx, shutdown_rx) = watch::channel (false);
|
|
|
|
ctrlc::set_handler (move || {
|
|
shutdown_tx.send (true).expect ("Couldn't forward Ctrl+C signal");
|
|
})?;
|
|
trace! ("Set Ctrl+C handler");
|
|
|
|
server::main (&args, Some (shutdown_rx)).await
|
|
}
|