Implemented basic connection logic
This commit is contained in:
6
main.c
6
main.c
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user