ptth/crates/ptth_quic/src/bin/quic_demo_end_server.rs

24 lines
512 B
Rust

use std::{
iter::FromIterator,
};
use tokio::sync::watch;
use quic_demo::prelude::*;
#[tokio::main]
async fn main () -> anyhow::Result <()> {
tracing_subscriber::fmt::init ();
let args = Vec::from_iter (std::env::args_os ());
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");
quic_demo::executable_end_server::main (&args, Some (shutdown_rx)).await
}