Skip to content

Commit

Permalink
added MAX_CLIENTS
Browse files Browse the repository at this point in the history
  • Loading branch information
mathieucarbou committed Oct 13, 2024
1 parent e8133fb commit b11bfff
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions examples/Client/Client.ino
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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();
}

Expand Down

0 comments on commit b11bfff

Please sign in to comment.