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.
This commit is contained in:
denisbider 2016-12-19 11:17:35 -06:00 committed by GitHub
parent fa99ece0c5
commit f3474ba157

View File

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