diff options
author | justanothercatgirl <sotov@twistea.su> | 2025-02-08 22:13:52 +0300 |
---|---|---|
committer | justanothercatgirl <sotov@twistea.su> | 2025-02-08 22:13:52 +0300 |
commit | cab382db088d9f240253466a1c5a26c62f3967c8 (patch) | |
tree | c5502f1b49211dccd3e29e163e708708495a6407 /server/main.c | |
parent | 3eeee14d5d5c93ae3d156aabae5a96d1c09f185a (diff) |
TODO: Implement multiplexing in worker threads (UDP loops), implement
channel_pool interface.
Diffstat (limited to 'server/main.c')
-rw-r--r-- | server/main.c | 17 |
1 files changed, 7 insertions, 10 deletions
diff --git a/server/main.c b/server/main.c index b6745e0..0d8d9f3 100644 --- a/server/main.c +++ b/server/main.c @@ -3,6 +3,7 @@ #define HSET_MAX_BUCKET_SIZE 4 #include <container.h> #undef CONTAINER_IMPLEMENTATION +#include <log.h> #include "tcp.h" @@ -11,22 +12,18 @@ #define MAIN_PORT 8164 void setup_signal(void) { - struct sigaction signal = {.sa_handler = print_state, .sa_mask = {{0}}, .sa_flags = 0}; - if (sigaction(SIGUSR1, &signal, NULL) != 0) { - WHERE; - exit(EXIT_FAILURE); - } + struct sigaction signal = {.sa_handler = print_state, .sa_mask = {{0}}, .sa_flags = SA_RESTART}; + if (sigaction(SIGUSR1, &signal, NULL) != 0) LFAILV("sigaction"); signal.sa_handler = exit_tcp; - if (sigaction(SIGTERM, &signal, NULL) != 0) { - WHERE; - exit(EXIT_FAILURE); - } + if (sigaction(SIGTERM, &signal, NULL) != 0) LFAILV("sigaction"); } int main(int argc, char *argv[]) { (void)argc; (void)argv; setup_signal(); - tcp_loop(); + new_tcp_loop(); return 0; } + +/* vim: set ts=8 noet: */ |