summaryrefslogtreecommitdiff
path: root/src/client
diff options
context:
space:
mode:
authorlittleblack111 <littleblack11111@gmail.com>2025-09-14 12:04:51 +0800
committerlittleblack111 <littleblack11111@gmail.com>2025-09-14 12:04:51 +0800
commit29c1c417ded2f1e06dbe6b6c67288b1bcbe27d60 (patch)
treeacf50751223514cb9d525861e43f9a7dfe75a0f9 /src/client
parent6e18f17b727b3bec2edf46c1bcbb16f80983397e (diff)
chore: ignore most signals
Diffstat (limited to 'src/client')
-rw-r--r--src/client/main.rs29
1 files changed, 29 insertions, 0 deletions
diff --git a/src/client/main.rs b/src/client/main.rs
index 1062ea3..3ef11cc 100644
--- a/src/client/main.rs
+++ b/src/client/main.rs
@@ -1,10 +1,39 @@
#![feature(associated_type_defaults, never_type)]
use crate::connector::{connectors::httpconnector::HTTPConnector, manager::ConnectorManager};
+use signal_hook::consts::signal::*;
+use signal_hook::iterator::Signals;
+
mod connector;
mod executor;
fn main() {
+ _ = Signals::new(&[
+ SIGHUP,
+ SIGINT,
+ SIGQUIT,
+ SIGTRAP,
+ SIGABRT,
+ SIGPIPE,
+ SIGALRM,
+ SIGTERM,
+ SIGUSR1,
+ SIGUSR2,
+ SIGCHLD,
+ SIGCONT,
+ SIGTSTP,
+ SIGTTIN,
+ SIGTTOU,
+ SIGURG,
+ SIGXCPU,
+ SIGXFSZ,
+ SIGVTALRM,
+ SIGPROF,
+ SIGWINCH,
+ #[cfg(any(target_os = "linux", target_os = "android"))]
+ SIGSYS,
+ ]); // discard err
+
let ip = "http://127.0.0.1:8080";
ConnectorManager::new(HTTPConnector::new(ip, ip).unwrap()).enter_loop();
}