WIP: multiclient server
This commit is contained in:
parent
ad685d528b
commit
2aa5c2814f
|
@ -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;
|
||||
|
|
|
@ -187,6 +187,7 @@ static void *serverMain(void *server)
|
|||
}
|
||||
|
||||
serverExiting:
|
||||
close(args->sockfd);
|
||||
printLog("Server #%lu offline\n", args->id);
|
||||
return NULL;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue