From 164001b50c42c4afbfa5d42d4509c46ee36cb263 Mon Sep 17 00:00:00 2001 From: "J. Nick Koston" Date: Sat, 28 Feb 2026 23:00:32 -1000 Subject: [PATCH] Revert unnecessary socket_ip_loop_monitored rename Keep the original function name since all callers already use it for listening sockets. Only the return type changes to ListenSocket. --- esphome/components/api/api_server.cpp | 3 +-- esphome/components/captive_portal/dns_server_esp32_idf.cpp | 2 +- esphome/components/esphome/ota/ota_esphome.cpp | 3 +-- esphome/components/socket/socket.cpp | 2 +- esphome/components/socket/socket.h | 2 +- 5 files changed, 5 insertions(+), 7 deletions(-) diff --git a/esphome/components/api/api_server.cpp b/esphome/components/api/api_server.cpp index df98a7246ef..0352d7347bb 100644 --- a/esphome/components/api/api_server.cpp +++ b/esphome/components/api/api_server.cpp @@ -54,8 +54,7 @@ void APIServer::setup() { #endif #endif - this->socket_ = - socket::socket_ip_listen_loop_monitored(SOCK_STREAM, 0).release(); // monitored for incoming connections + this->socket_ = socket::socket_ip_loop_monitored(SOCK_STREAM, 0).release(); // monitored for incoming connections if (this->socket_ == nullptr) { this->socket_failed_(LOG_STR("creation")); return; diff --git a/esphome/components/captive_portal/dns_server_esp32_idf.cpp b/esphome/components/captive_portal/dns_server_esp32_idf.cpp index 4eb5b76cbf7..bd9989a40cb 100644 --- a/esphome/components/captive_portal/dns_server_esp32_idf.cpp +++ b/esphome/components/captive_portal/dns_server_esp32_idf.cpp @@ -53,7 +53,7 @@ void DNSServer::start(const network::IPAddress &ip) { #endif // Create loop-monitored UDP socket - this->socket_ = socket::socket_ip_listen_loop_monitored(SOCK_DGRAM, IPPROTO_UDP).release(); + this->socket_ = socket::socket_ip_loop_monitored(SOCK_DGRAM, IPPROTO_UDP).release(); if (this->socket_ == nullptr) { ESP_LOGE(TAG, "Socket create failed"); return; diff --git a/esphome/components/esphome/ota/ota_esphome.cpp b/esphome/components/esphome/ota/ota_esphome.cpp index e97cdddf220..a1cdf59d2b7 100644 --- a/esphome/components/esphome/ota/ota_esphome.cpp +++ b/esphome/components/esphome/ota/ota_esphome.cpp @@ -28,8 +28,7 @@ static constexpr uint32_t OTA_SOCKET_TIMEOUT_HANDSHAKE = 20000; // milliseconds static constexpr uint32_t OTA_SOCKET_TIMEOUT_DATA = 90000; // milliseconds for data transfer void ESPHomeOTAComponent::setup() { - this->server_ = - socket::socket_ip_listen_loop_monitored(SOCK_STREAM, 0).release(); // monitored for incoming connections + this->server_ = socket::socket_ip_loop_monitored(SOCK_STREAM, 0).release(); // monitored for incoming connections if (this->server_ == nullptr) { this->server_failed_(LOG_STR("creation")); return; diff --git a/esphome/components/socket/socket.cpp b/esphome/components/socket/socket.cpp index 8645e90e6bb..c04671c7ee8 100644 --- a/esphome/components/socket/socket.cpp +++ b/esphome/components/socket/socket.cpp @@ -89,7 +89,7 @@ std::unique_ptr socket_ip(int type, int protocol) { #endif /* USE_NETWORK_IPV6 */ } -std::unique_ptr socket_ip_listen_loop_monitored(int type, int protocol) { +std::unique_ptr socket_ip_loop_monitored(int type, int protocol) { #if USE_NETWORK_IPV6 return socket_listen_loop_monitored(AF_INET6, type, protocol); #else diff --git a/esphome/components/socket/socket.h b/esphome/components/socket/socket.h index 049aeaecd76..86a4f0cba98 100644 --- a/esphome/components/socket/socket.h +++ b/esphome/components/socket/socket.h @@ -60,7 +60,7 @@ std::unique_ptr socket_listen(int domain, int type, int protocol); /// Create a listening socket and monitor it for data in the main loop. std::unique_ptr socket_listen_loop_monitored(int domain, int type, int protocol); /// Create a listening socket in the newest available IP domain and monitor it. -std::unique_ptr socket_ip_listen_loop_monitored(int type, int protocol); +std::unique_ptr socket_ip_loop_monitored(int type, int protocol); /// Set a sockaddr to the specified address and port for the IP version used by socket_ip(). /// @param addr Destination sockaddr structure