Increase maximum connection count on Windows from 2048 to 8192.

This is only where supported.

Closes #2122. Thanks to yellowgg2.
This commit is contained in:
Roger A. Light
2021-03-08 13:19:34 +00:00
parent 3d882b79a9
commit 072103823b
2 changed files with 9 additions and 1 deletions
+2
View File
@@ -7,6 +7,8 @@ Broker:
- Add connection-state example plugin to demonstrate MOSQ_EVT_CONNECT.
- Plugins on non-Windows platforms now no longer make their symbols globally
available, which means they are self contained.
- Increase maximum connection count on Windows from 2048 to 8192 where
supported. Closes #2122.
Client library:
- Add MOSQ_OPT_DISABLE_SOCKETPAIR to allow the disabling of the socketpair
+7 -1
View File
@@ -481,7 +481,13 @@ int main(int argc, char *argv[])
#endif
#ifdef WIN32
_setmaxstdio(2048);
if(_setmaxstdio(8192) != 8192){
/* Old limit was 2048 */
if(_setmaxstdio(2048) != 2048){
log__printf(NULL, MOSQ_LOG_WARNING, "Warning: Unable to increase maximum allowed connections. This session may be limited to 512 connections.");
}
}
#endif
memset(&db, 0, sizeof(struct mosquitto_db));