WIP: multiclient server

This commit is contained in:
Adrien Bourmault 2021-07-09 15:58:47 +02:00
parent ad685d528b
commit 2aa5c2814f
No known key found for this signature in database
GPG Key ID: 6EB408FE0ACEC664
2 changed files with 2 additions and 1 deletions

View File

@ -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;

View File

@ -187,6 +187,7 @@ static void *serverMain(void *server)
}
serverExiting:
close(args->sockfd);
printLog("Server #%lu offline\n", args->id);
return NULL;
}