Skip to content
This repository was archived by the owner on Jan 20, 2025. It is now read-only.
This repository was archived by the owner on Jan 20, 2025. It is now read-only.

FR: Allow configuring LwIP's keepalives #114

@positron96

Description

@positron96

Hi.
Is it possible to add support for TCP keepalives (and methods to enable/disable/configure them)? As I understand, LwIP has this functionality and it can be enabled on per-socket basis (I just don't know if it's compiled into ESP32 core).

You see, it's not uncommon in embedded world to just unplug the device from power, in this case a TCP connection will be hanging on the other side and some non-trivial logic would be required to detect and close it. I am testing an application with AsyncServer on one ESP32 and long-lasting TCP connection to WiFiClient on other ESP32, and this ESP32 can be unplugged from power without proper termination. In this case I don't see a onDisconnect called on server side, as well as no events (timeouts, errors) that could help in detecting broken connection. The only approach at the moment is to write my own keep-alive logic, but that would be so cumbersome, not to mention changes in upper-level protocol.

Might be useful: https://stackoverflow.com/questions/29492995/lwip-stack-netconn-api-keep-connection-keep-alive

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions