This commit is contained in:
2024-02-05 16:15:54 +01:00
parent f01e816643
commit 129abeea13
2 changed files with 11 additions and 2 deletions

View File

@@ -6,7 +6,7 @@
/* By: vvaas <vvaas@student.42angouleme.fr> +#+ +:+ +#+ */ /* By: vvaas <vvaas@student.42angouleme.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */ /* +#+#+#+#+#+ +#+ */
/* Created: 2024/01/22 09:45:10 by maldavid #+# #+# */ /* Created: 2024/01/22 09:45:10 by maldavid #+# #+# */
/* Updated: 2024/01/30 17:34:11 by maldavid ### ########.fr */ /* Updated: 2024/02/05 16:13:06 by vvaas ### ########.fr */
/* */ /* */
/******************************************************************************/ /******************************************************************************/
@@ -16,6 +16,7 @@
#define INPUT_SIZE 1024 #define INPUT_SIZE 1024
#define LOGS_BUFFER_SIZE 4096 #define LOGS_BUFFER_SIZE 4096
#define MAX_USERS 20 #define MAX_USERS 20
#define FD_MAX 1023
#define NULL_SOCKET -1 #define NULL_SOCKET -1
#define LEGAL_CHARACTER "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789{}[]\\|^`-_" #define LEGAL_CHARACTER "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789{}[]\\|^`-_"

View File

@@ -6,7 +6,7 @@
/* By: vvaas <vvaas@student.42angouleme.fr> +#+ +:+ +#+ */ /* By: vvaas <vvaas@student.42angouleme.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */ /* +#+#+#+#+#+ +#+ */
/* Created: 2024/01/21 09:31:17 by maldavid #+# #+# */ /* Created: 2024/01/21 09:31:17 by maldavid #+# #+# */
/* Updated: 2024/02/05 14:10:19 by vvaas ### ########.fr */ /* Updated: 2024/02/05 16:14:13 by vvaas ### ########.fr */
/* */ /* */
/******************************************************************************/ /******************************************************************************/
@@ -232,5 +232,13 @@ namespace irc
Server::~Server() Server::~Server()
{ {
closeMainSocket(); closeMainSocket();
for(int i = 0; i < FD_MAX; ++i)
{
if (FD_ISSET(i, &_fd_set))
{
close(i);
FD_CLR(i, &_fd_set);
}
}
} }
} }