Skip to content

Trying to use MEMP_NUM_TCP_PCB +1 TCP connections terminates existing TCP connection #9

@habazut

Description

@habazut

Describe the bug

The LwIP implementation has a compiled in maximum number of TCP connections (MEMP_NUM_TCP_PCB) that can be active simultaniously. By default this seems to be 10. If now the 11th TCP connection is opened then the library does not reject connection number 11 but instead terminates one of the 10 existing active connections.

To Reproduce

Write a small program that accepts N TCP connections echoing characters and connect with for example telnet. Look at the behaviour when connection 11 is connected.

Expected behavior

Connection 11 is rejected.

Versions

Resolving Nucleo-F429ZI dependencies...
Platform ststm32 @ 17.6.0 (required: ststm32 @ 17.6.0)
├── framework-arduinoststm32 @ 4.20801.240815 (required: platformio/framework-arduinoststm32 @ ~4.20801.0)
├── framework-cmsis @ 2.50900.0 (required: platformio/framework-cmsis @ ~2.50900.0)
├── tool-dfuutil @ 1.11.0 (required: platformio/tool-dfuutil @ ~1.11.0)
├── tool-dfuutil-arduino @ 1.11.0 (required: platformio/tool-dfuutil-arduino @ ~1.11.0)
├── tool-openocd @ 3.1200.0 (required: platformio/tool-openocd @ ~3.1200.0)
├── tool-stm32duino @ 1.0.1 (required: platformio/tool-stm32duino @ ~1.0.1)
└── toolchain-gccarmnoneeabi @ 1.120301.0 (required: platformio/toolchain-gccarmnoneeabi @ ~1.120301.0)

Libraries
├── STM32Ethernet @ 1.4.0 (required: stm32duino/STM32Ethernet @ ^1.4.0)
└── STM32duino LwIP @ 2.1.3 (required: stm32duino/STM32duino LwIP @ ^2.1.3)

$ pio --version
PlatformIO Core, version 6.1.6

Hardware (please complete the following information):
Nucleo-F429ZI

Additional context

I have not succeeded to turn on the LwIP builtin debugging ... none of the descriptions I did find on the net did actually result in any output to serial, sorry.

The DCCEX project uses this here:
(URL to current code which uses LwIP)
https://github.com/DCC-EX/CommandStation-EX/tree/6b0dc272ea8f8191ba7e3fd20c1f835b975bb699
It's not a small project and one needs first to turn on ethernet support so it listens to TCP on port 2560

Regards,
Harald

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions