Replace the unwieldy 6-tuple with a frozen dataclass for clarity
and named attribute access at call sites.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Clarify MIN_TCP_SOCKETS comment: covers minimal configs (api-only);
when web_server is present its 5 sockets push past the minimum.
- Add MIN_TCP_LISTEN_SOCKETS = 2 alongside MIN_TCP/MIN_UDP for
consistency instead of hardcoding the value in libretiny.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
BK SDK sets TCP_SND_BUF=10×MSS on both plans but TCP_WND varies:
3×MSS (reduced plan) vs 10×MSS (default plan). Also update stale
minimum counts in docstring (8 TCP / 6 UDP).
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Previous minimums (10/8) were overly conservative. Most configs
register their actual needs via consume_sockets(), so the minimums
only need to cover unregistered components with modest headroom.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
get_socket_counts() now returns component detail strings alongside
counts so platforms can include them in their log messages. ESP32
INFO log now shows which components consume each socket type.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
CONFIG_LWIP_MAX_SOCKETS is a single VFS socket pool shared by all
socket types. Listening sockets consume file descriptors too, so
they must be included in the total.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- 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>
- Remove SOCKET_TCP/SOCKET_UDP aliases, use SocketType.UDP everywhere
- Fix MEMP_NUM_NETCONN to include listening_tcp (listeners need netconns)
- Add comment on listening_tcp minimum (not all components register yet)
- Add comment on MAX_LISTENING_SOCKETS_TCP (BK-specific, RTL/LN use
MEMP_NUM_TCP_PCB_LISTEN directly)
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Components now register their listening sockets explicitly instead of
relying on a hardcoded count. web_server_base registers the shared
HTTP listener (used by both web_server and captive_portal). The
libretiny lwIP config derives MEMP_NUM_TCP_PCB_LISTEN dynamically
from these registrations.
Also fixes captive_portal to correctly register its DNS socket as UDP
instead of TCP.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Move MEM_LIBC_MALLOC=1 and MEMP_MEM_MALLOC=1 from BK72XX-only to all
LibreTiny platforms. All three SDKs (BK/RTL/LN) wire malloc to
FreeRTOS pvPortMalloc (thread-safe), and WiFi receive paths run in
task context.
Tested on RTL87xx (BW15): 84,184 B → 103,744 B free heap (~19.6KB
freed). OTA and web server confirmed working.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>