mirror of
https://github.com/esphome/esphome.git
synced 2026-07-10 08:55:36 +00:00
[socket] Move socket_loop_monitored declaration before UDP factories
Fix forward declaration ordering: socket_udp_recv_loop_monitored calls socket_loop_monitored, so the latter must be declared first.
This commit is contained in:
@@ -88,6 +88,14 @@ std::unique_ptr<Socket> socket(int domain, int type, int protocol);
|
||||
/// Create a socket in the newest available IP domain (IPv6 or IPv4) of the given type and protocol.
|
||||
std::unique_ptr<Socket> socket_ip(int type, int protocol);
|
||||
|
||||
/// Create a socket and monitor it for data in the main loop.
|
||||
/// Like socket() but also registers the socket with the Application's select() loop.
|
||||
/// WARNING: These functions are NOT thread-safe. They must only be called from the main loop
|
||||
/// as they register the socket file descriptor with the global Application instance.
|
||||
/// NOTE: On ESP platforms, FD_SETSIZE is typically 10, limiting the number of monitored sockets.
|
||||
/// File descriptors >= FD_SETSIZE will not be monitored and will log an error.
|
||||
std::unique_ptr<Socket> socket_loop_monitored(int domain, int type, int protocol);
|
||||
|
||||
/// Create a send-only UDP socket of the given domain and protocol.
|
||||
#ifdef USE_SOCKET_IMPL_LWIP_TCP
|
||||
std::unique_ptr<UDPSocket> socket_udp(int domain, int protocol);
|
||||
@@ -140,14 +148,6 @@ inline std::unique_ptr<UDPRecvSocket> socket_ip_udp_recv_loop_monitored(int prot
|
||||
#endif
|
||||
}
|
||||
|
||||
/// Create a socket and monitor it for data in the main loop.
|
||||
/// Like socket() but also registers the socket with the Application's select() loop.
|
||||
/// WARNING: These functions are NOT thread-safe. They must only be called from the main loop
|
||||
/// as they register the socket file descriptor with the global Application instance.
|
||||
/// NOTE: On ESP platforms, FD_SETSIZE is typically 10, limiting the number of monitored sockets.
|
||||
/// File descriptors >= FD_SETSIZE will not be monitored and will log an error.
|
||||
std::unique_ptr<Socket> socket_loop_monitored(int domain, int type, int protocol);
|
||||
|
||||
/// Create a listening socket of the given domain, type and protocol.
|
||||
/// Create a listening socket and monitor it for data in the main loop.
|
||||
/// Create a listening socket in the newest available IP domain and monitor it.
|
||||
|
||||
Reference in New Issue
Block a user