From ad685d528bb7d5d1f02c4fbcef2582252ff2849f Mon Sep 17 00:00:00 2001 From: Adrien Bourmault Date: Fri, 9 Jul 2021 02:57:26 +0200 Subject: [PATCH] Multiple clients ! --- src/server.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/server.c b/src/server.c index 673b55e..cdd4798 100644 --- a/src/server.c +++ b/src/server.c @@ -165,11 +165,13 @@ static void *serverMain(void *server) // Accept the data packet from client connfd = accept(args->sockfd, (struct sockaddr*)&cli, &len); if (connfd < 0) { + // If error is not due to lack of clients connecting, this is error if (errno != EWOULDBLOCK) { printLog("Server acccept failed!\n"); goto serverExiting; } } else { + // Client connected, creating a thread printLog("Client accepted\n"); serverSlots[serverSlotIndex].sockfd = connfd;