Explain number of allowed connections

This commit is contained in:
Igor Socec 2016-11-19 15:10:57 +01:00
parent b934bb120c
commit 9703b42b3a
3 changed files with 7 additions and 3 deletions

View file

@ -52,8 +52,8 @@ int server_setup(server_t *server, unsigned int port)
server->port = port;
fprintf(stderr,"[%s] assigned port %u\n", __func__, server->port); // ntohs(server->address.sin_port)
/* listen for a client connection, allow some connections in queue */
if (listen(server->socket, 1) == -1)
/* listen for a client connection, allow (max-1) connections in queue */
if (listen(server->socket, (SERVER_MAX_CONNECTIONS - 1)) == -1)
{
fprintf(stderr, "[%s:%d] error %d: %s\n", __func__, __LINE__,
errno, strerror(errno));