Multiple clients !
This commit is contained in:
parent
428ac5ff4f
commit
ad685d528b
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue