mirror of
https://github.com/esphome/esphome.git
synced 2026-07-10 17:05:36 +00:00
5bd7f0ea960209344a3ee8e71f2a16ff69f96e7d
Cache struct lwip_sock* pointers at socket registration time instead of looking them up by fd on every iteration. The previous code stored file descriptors and called lwip_socket_dbg_get_socket(fd) on every loop iteration to convert each fd back to a pointer — only to read a single field from it. - register_socket(lwip_sock*) returns bool and hooks the callback internally — replaces the separate register_socket_fd + hook dance - Hot loop iterates struct lwip_sock* directly instead of converting fds each iteration - Socket::ready() uses the cached pointer instead of fd lookup - esphome_lwip_hook_socket() takes struct lwip_sock* directly - esphome_lwip_socket_has_data() moved to header as static inline for inlining — uses offset-based access verified by _Static_assert - Null cached_sock_ on close to prevent post-close dereference - socket_ready() tolerant of null pointer for safety
Description
ESPHome is a system to control your ESP8266/ESP32 by simple yet powerful configuration files and control them remotely through Home Automation systems.
Readme
Multiple Licenses
546 MiB
Languages
C++
60.1%
Python
39.3%
C
0.3%
JavaScript
0.2%
