added MAX_CLIENTS

This commit is contained in:
Mathieu Carbou
2024-10-13 10:21:00 +02:00
parent e8133fbd46
commit b11bfff4fd

View File

@@ -18,7 +18,11 @@
#define HOST "192.168.125.118" #define HOST "192.168.125.118"
#define PORT 4000 #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() { void makeRequest() {
if (!permits) if (!permits)
@@ -75,8 +79,7 @@ void setup() {
Serial.println("** connected to WiFi"); Serial.println("** connected to WiFi");
Serial.println(WiFi.localIP()); Serial.println(WiFi.localIP());
// 16 slots on esp32 (CONFIG_LWIP_MAX_ACTIVE_TCP) for (size_t i = 0; i < MAX_CLIENTS; i++)
for (size_t i = 0; i < CONFIG_LWIP_MAX_ACTIVE_TCP; i++)
makeRequest(); makeRequest();
} }