Implemented basic connection logic

This commit is contained in:
Nikita Tyukalov, ASUS, Linux
2026-03-25 00:25:47 +03:00
parent 7eaf35ea4c
commit 8e90c4c152
6 changed files with 572 additions and 1 deletions

6
main.c
View File

@@ -10,6 +10,7 @@
#include <sys/signalfd.h>
#include "event_loop.h"
#include "connection.h"
#include "server.h"
#include "utils.h"
@@ -179,6 +180,10 @@ static void on_fd_event(int fd, uint32_t events) {
_to_work = false;
}
}
// Connection event
else if (connection_is_socket_managed(fd)) {
connection_event(fd, events);
}
else {
fprintf(stderr, "[!] Event has happened on an unknown file descriptor\n");
}
@@ -216,6 +221,7 @@ int main(int argc, char **argv) {
if (_is_server) {
server_close();
}
connection_cleanup();
signals_deinit();
loop_deinit();
return 0;