From 2aa5c2814feb328ded2056829968721503be2dfd Mon Sep 17 00:00:00 2001 From: Adrien Bourmault Date: Fri, 9 Jul 2021 15:58:47 +0200 Subject: [PATCH] WIP: multiclient server --- src/cli.c | 2 +- src/server.c | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/cli.c b/src/cli.c index 83f37c2..b6d1398 100644 --- a/src/cli.c +++ b/src/cli.c @@ -222,7 +222,7 @@ int main() struct sockaddr_in servaddr; // Socket creation - sockfd = socket(AF_INET, SOCK_STREAM, 0); + sockfd = socket(PF_INET, SOCK_STREAM, 0); if (sockfd == -1) { printLog("Socket creation failed!\n"); return 1; diff --git a/src/server.c b/src/server.c index cdd4798..2423d2c 100644 --- a/src/server.c +++ b/src/server.c @@ -187,6 +187,7 @@ static void *serverMain(void *server) } serverExiting: + close(args->sockfd); printLog("Server #%lu offline\n", args->id); return NULL; }