alexCajas / EmbeddedMqttBroker

This is a Mqtt broker for embedded devices, developed in C++, FreeRTOS to use advanced multitasking capabilities, and arduino core. Tested in an Esp32 and esp8266.
https://github.com/alexCajas/EmbeddedMqttBroker
MIT License
71 stars 14 forks source link

increase the possible mqtt connection from 9 to 16 not possible #3

Closed utz-michael closed 1 year ago

utz-michael commented 2 years ago

the default configuration fo the example is 9 possilbe connections this works great. if i decrease to 4 connections the broker allows max of 4. however if i increase to 16 i still can connect 9 mqtt clients.

alexCajas commented 2 years ago

Hi!, your right, I tested the project again and the limit is 10 now, probably when I wrote this project some years ago, arduino core for esp32 did let us to open 16 TCP sockets, but with the recent releases the limit is 10 sockets, in your case, 1 TCP socket for listen and 9 for clients. If you use broker and http server at the same time you are using 1 TCP socket to listen on the broker and other to listen on the web server, letting you 8 sockets for clients. I was looking for similars isues in espressif github page and I found this: https://github.com/espressif/esp-idf/issues/4900, this isue is from 2020, and it talk about 16 TCP connections, probably some release of that year includes a version of lwIp library, which accepts 16 TCP sockets.