[socket] Update comments for new TCP_LISTEN registration model

- OTA: note that active transfer uses a TCP PCB from general pool
- MIN_TCP_SOCKETS: update base count to api(3) after TCP_LISTEN split

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
J. Nick Koston
2026-02-21 17:10:29 -06:00
parent c90ab6f72f
commit bfde66f7f4
2 changed files with 3 additions and 2 deletions

View File

@@ -97,7 +97,8 @@ def _consume_ota_sockets(config: ConfigType) -> ConfigType:
"""Register socket needs for OTA component."""
from esphome.components import socket
# OTA needs 1 listening socket (client connections are temporary during updates)
# OTA needs 1 listening socket. The active transfer connection during an update
# uses a TCP PCB from the general pool, covered by MIN_TCP_SOCKETS headroom.
socket.consume_sockets(1, "ota", socket.SocketType.TCP_LISTEN)(config)
return config

View File

@@ -23,7 +23,7 @@ KEY_SOCKET_CONSUMERS_TCP_LISTEN = "socket_consumers_tcp_listen"
# Recommended minimum socket counts to ensure headroom.
# Platforms should apply these (or their own) on top of get_socket_counts().
# TCP: api(4) + ota(1) = 5 base, +5 headroom for web_server/other components.
# TCP: api(3) = 3 base, +7 headroom for web_server(5)/ota-transfer/other.
# UDP: dhcp(1) + dns(1) + mdns(2) + wake_loop(1) = 5 base, +3 headroom.
MIN_TCP_SOCKETS = 10
MIN_UDP_SOCKETS = 8