mirror of
https://github.com/espressif/esp-idf.git
synced 2026-09-22 13:01:16 +03:00
Latency-sensitive small-message protocols (notably MQTT: PUBLISH/PUBACK/ PINGREQ) suffer when Nagle's algorithm interacts with the peer's delayed-ACK: a small write is withheld until the prior segment is ACKed while the peer holds that ACK up to ~40-200 ms, stalling each small write until the delayed-ACK timer fires. Add CONFIG_ESP_TLS_ENABLE_TCP_NODELAY (default n). When enabled, esp_tls_set_socket_options() sets TCP_NODELAY on the connection socket alongside the existing SO_*TIMEO / keepalive options, so small records go out immediately. Non-fatal (a latency hint), so a failure only warns. Off by default: no behavior change for existing users. Signed-off-by: Eric Wang <eric@rwx.one>