Files
esphome/esphome/components/socket
J. Nick Koston ec833ce2d9 [core] Move host socket-select wake mechanism into wake.h/wake.cpp
The host platform's wake plumbing was split between wake.cpp (which had
wake_loop_threadsafe()) and application.{h,cpp} (which owned the fd
registry, wake socket lifecycle, select() loop, and readiness query).
The split required application.h to friend wake_loop_threadsafe() and
expose the wake socket fd, and forced a host-only out-of-line override
of yield_with_select_() that was equivalent to wakeable_delay() on every
other platform.

Consolidate the host wake mechanism in wake.h/wake.cpp:

- New host-only API: wake_register_fd, wake_unregister_fd, wake_fd_ready,
  wake_setup, wake_drain_notifications.
- Host implementation of internal::wakeable_delay now performs the
  select() over registered fds, mirroring the role of xTaskNotifyTake on
  ESP32 and esp_delay on ESP8266.
- Application drops the host-specific socket_fds_, max_fd_,
  wake_socket_fd_, socket_fds_changed_, read_fds_, base_read_fds_
  members, the host include block (sys/select.h, sys/socket.h, etc.),
  and the friend declarations for wake_loop_threadsafe() and
  socket::socket_ready_fd().
- yield_with_select_() collapses to a single inline definition for all
  platforms that delegates to wakeable_delay().
- Socket factories (bsd_sockets_impl.cpp, lwip_sockets_impl.cpp) and
  socket::socket_ready_fd() now call the wake.h API directly instead of
  going through App.
2026-04-23 00:33:04 +02:00
..