From b11bfff4fd98eb405609278984fbaf83d5e4007e Mon Sep 17 00:00:00 2001 From: Mathieu Carbou Date: Sun, 13 Oct 2024 10:21:00 +0200 Subject: [PATCH] added MAX_CLIENTS --- examples/Client/Client.ino | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/examples/Client/Client.ino b/examples/Client/Client.ino index d41b196..cf3de05 100644 --- a/examples/Client/Client.ino +++ b/examples/Client/Client.ino @@ -18,7 +18,11 @@ #define HOST "192.168.125.118" #define PORT 4000 -size_t permits = CONFIG_LWIP_MAX_ACTIVE_TCP; +// 16 slots on esp32 (CONFIG_LWIP_MAX_ACTIVE_TCP) +#define MAX_CLIENTS CONFIG_LWIP_MAX_ACTIVE_TCP +// #define MAX_CLIENTS 3 + +size_t permits = MAX_CLIENTS; void makeRequest() { if (!permits) @@ -75,8 +79,7 @@ void setup() { Serial.println("** connected to WiFi"); Serial.println(WiFi.localIP()); - // 16 slots on esp32 (CONFIG_LWIP_MAX_ACTIVE_TCP) - for (size_t i = 0; i < CONFIG_LWIP_MAX_ACTIVE_TCP; i++) + for (size_t i = 0; i < MAX_CLIENTS; i++) makeRequest(); }