1
0
mirror of https://github.com/DCC-EX/CommandStation-EX.git synced 2024-12-23 12:51:24 +01:00

adjust max default TCP clients to 9 because of bug in LwIP

This commit is contained in:
Harald Barth 2024-12-05 22:03:55 +01:00
parent 6b0dc272ea
commit e0aa16ff2c
3 changed files with 21 additions and 4 deletions

View File

@ -29,7 +29,15 @@
// we can not include our "defines.h" here // we can not include our "defines.h" here
// so we need to duplicate that define // so we need to duplicate that define
#define MAX_NUM_TCP_CLIENTS 20 #define MAX_NUM_TCP_CLIENTS_HERE 9
#ifdef MAX_NUM_TCP_CLIENTS
#if MAX_NUM_TCP_CLIENTS != MAX_NUM_TCP_CLIENTS_HERE
#error MAX_NUM_TCP_CLIENTS and MAX_NUM_TCP_CLIENTS_HERE must be same
#endif
#else
#define MAX_NUM_TCP_CLIENTS MAX_NUM_TCP_CLIENTS_HERE
#endif
// increase ARP cache // increase ARP cache
#undef MEMP_NUM_APR_QUEUE #undef MEMP_NUM_APR_QUEUE

View File

@ -140,7 +140,10 @@ The configuration file for DCC-EX Command Station
///////////////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////////////
// //
// MAX_NUM_TCP_CLIENTS: If you on STM32 Ethernet (and only there) want more than // MAX_NUM_TCP_CLIENTS: If you on STM32 Ethernet (and only there) want more than
// 10 TCP clients, enable this here **AND** follow the instructions in STM32lwiopts.h // 9 (*) TCP clients, change this number to for example 20 here **AND** in
// STM32lwiopts.h and follow the instructions in STM32lwiopts.h
//
// (*) It would be 10 if there would not be a bug in LwIP by STM32duino.
// //
//#define MAX_NUM_TCP_CLIENTS 20 //#define MAX_NUM_TCP_CLIENTS 20

View File

@ -240,9 +240,15 @@
#endif #endif
#if defined(ARDUINO_ARCH_STM32) #if defined(ARDUINO_ARCH_STM32)
// Allow override of MAX_NUM_TCP_CLIENTS but default is 10 // The LwIP library for the STM32 wired ethernet has by default 10 TCP
// clients defined but because of a bug in the library #11 is not
// rejected but kicks out any old connection. By restricting our limit
// to 9 the #10 will be rejected by our code so that the number can
// never get to 11 which would kick an existing connection.
// If you want to change this value, do that in
// config.h AND in STM32lwipopts.h.
#ifndef MAX_NUM_TCP_CLIENTS #ifndef MAX_NUM_TCP_CLIENTS
#define MAX_NUM_TCP_CLIENTS 10 #define MAX_NUM_TCP_CLIENTS 9
#endif #endif
#else #else
#if defined(ARDUINO_ARCH_ESP32) #if defined(ARDUINO_ARCH_ESP32)