mirror of
https://github.com/esphome/esphome.git
synced 2026-09-22 04:28:43 +00:00
Fix socket to_code: USE_SOCKET_SELECT_SUPPORT only for BSD sockets on host
This commit is contained in:
@@ -168,11 +168,14 @@ async def to_code(config):
|
||||
# Only when not using lwip_tcp, which does not provide select() support.
|
||||
if (CORE.is_esp32 or CORE.is_libretiny) and impl != IMPLEMENTATION_LWIP_TCP:
|
||||
cg.add_build_flag("-DUSE_LWIP_FAST_SELECT")
|
||||
elif impl != IMPLEMENTATION_LWIP_TCP:
|
||||
if (
|
||||
impl == IMPLEMENTATION_BSD_SOCKETS
|
||||
and not CORE.is_esp32
|
||||
and not CORE.is_libretiny
|
||||
):
|
||||
# Host platform: uses select() syscall for socket monitoring
|
||||
# and a UDP loopback socket for wake_loop_threadsafe()
|
||||
cg.add_define("USE_SOCKET_SELECT_SUPPORT")
|
||||
# Platforms with select() but without fast select (host) need a UDP
|
||||
# loopback socket for wake_loop_threadsafe().
|
||||
consume_sockets(1, "socket.wake_loop_threadsafe", SocketType.UDP)({})
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user