ESPHome 2026.3.0-dev
Loading...
Searching...
No Matches
dns_server_esp32_idf.h
Go to the documentation of this file.
1#pragma once
2#ifdef USE_ESP32
3
7
9
10class DNSServer {
11 public:
12 void start(const network::IPAddress &ip);
13 void stop();
15
16 protected:
17 // No explicit close() needed — listen sockets have no active connections on
18 // failure/shutdown. Destructor handles fd cleanup (close or abort per platform).
19 inline void destroy_socket_() {
20 delete this->socket_;
21 this->socket_ = nullptr;
22 }
23 static constexpr size_t DNS_BUFFER_SIZE = 192;
24
28};
29
30} // namespace esphome::captive_portal
31
32#endif // USE_ESP32
void start(const network::IPAddress &ip)