Files
esp-idf/components/esp-tls
Eric Wang 850d652f00 feat(esp-tls): add opt-in TCP_NODELAY (CONFIG_ESP_TLS_ENABLE_TCP_NODELAY)
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>
2026-07-20 14:27:04 -07:00
..