summaryrefslogtreecommitdiff
path: root/server.h
diff options
context:
space:
mode:
authorJohnny Richard <johnny@johnnyrichard.com>2022-04-07 15:59:05 +0200
committerJohnny Richard <johnny@johnnyrichard.com>2022-04-07 15:59:05 +0200
commitde5ee6a519b86f5ff78e6849c5704243c8c9c109 (patch)
treeaae9d3857b5c7357469539fb2b8ade026506ad98 /server.h
parent1b684971c3b591538c3ba0d3343ec76559f10203 (diff)
server.c: Accept multiple clients concurrently
Diffstat (limited to 'server.h')
-rw-r--r--server.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/server.h b/server.h
index 0fa4f5b..0474f9f 100644
--- a/server.h
+++ b/server.h
@@ -20,9 +20,16 @@
#include <stdint.h>
#include <stdbool.h>
+#include <sys/epoll.h>
+
+#define MAXEVENTS 64
typedef struct server {
int fd;
+ int epoll_fd;
+ struct epoll_event events[MAXEVENTS];
+ int connected_clients[MAXEVENTS];
+ int connected_clients_index;
bool running;
} server_t;