From f3474ba157c7b928083d9bc8031f294cbd77609b Mon Sep 17 00:00:00 2001 From: denisbider Date: Mon, 19 Dec 2016 11:17:35 -0600 Subject: [PATCH] Updated default Socket::Listen backlog parameter Default backlog value was 5, which appears to stem back to the maximum supported by Windows Sockets 1. This was bound to cause problems for applications receiving many connections at the same time. Changed to SOMAXCONN, which is the standard way on Windows and POSIX to use a maximum reasonable backlog value. --- socketft.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/socketft.h b/socketft.h index af136d69..0fefb65c 100644 --- a/socketft.h +++ b/socketft.h @@ -72,7 +72,7 @@ public: void Create(int nType = SOCK_STREAM); void Bind(unsigned int port, const char *addr=NULL); void Bind(const sockaddr* psa, socklen_t saLen); - void Listen(int backlog=5); + void Listen(int backlog = SOMAXCONN); // the next three functions return false if the socket is in nonblocking mode // and the operation cannot be completed immediately bool Connect(const char *addr, unsigned int port);