diff --git a/ChangeLog.txt b/ChangeLog.txt index 11c0972b..75a03b18 100644 --- a/ChangeLog.txt +++ b/ChangeLog.txt @@ -7,6 +7,8 @@ Broker: assertions removed. Closes #2708. - Fix default settings incorrectly allowing TLS v1.1. Closes #2722. - Use line buffered mode for stdout. Closes #2354. Closes #2749. +- Fix connections being limited to 2048 on Windows. The limit is now 8192, + where supported. Closes #2732. Client library: - Use CLOCK_BOOTTIME when available, to keep track of time. This solves the diff --git a/src/mosquitto.c b/src/mosquitto.c index 4dfd2bde..431254d8 100644 --- a/src/mosquitto.c +++ b/src/mosquitto.c @@ -484,7 +484,12 @@ 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));