From 8ade84b9bebcf4777ae71f3e546d91fa37f3fede Mon Sep 17 00:00:00 2001 From: Egor Date: Tue, 17 May 2022 19:23:38 +0300 Subject: [PATCH] use SOMAXCONN as the backlog --- config.h | 2 +- main.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/config.h b/config.h index 7b990e9..b64f021 100644 --- a/config.h +++ b/config.h @@ -1,6 +1,6 @@ #define LISTENING_PORT 6667 #define LISTENING_PORT_TLS 6697 -#define LISTENING_BACKLOG 10 +#define LISTENING_BACKLOG SOMAXCONN #define CLIENTS 30 #define SUPPORT_IPV4 #define SUPPORT_IPV6 diff --git a/main.c b/main.c index df688ee..1a0e488 100644 --- a/main.c +++ b/main.c @@ -114,7 +114,7 @@ SOCKET create_listen_sock(int af, struct sockaddr *addr, size_t len) exit(EXIT_FAILURE); } // Listen to socket - if(listen(sock, LISTENING_BACKLOG) == -1) { + if(listen(sock, SOMAXCONN) == -1) { net_perror("ERROR LISTEN"); exit(EXIT_FAILURE); } -- 2.56.0