Skip to content

Commit 30c6df4

Browse files
authored
WiFiServer - operator bool() and method end() (#8995)
1 parent 497dacc commit 30c6df4

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

Diff for: libraries/ESP8266WiFi/src/WiFiServer.cpp

+8
Original file line numberDiff line numberDiff line change
@@ -173,6 +173,14 @@ void WiFiServer::stop() {
173173
close();
174174
}
175175

176+
void WiFiServer::end() {
177+
close();
178+
}
179+
180+
WiFiServer::operator bool() {
181+
return (status() != CLOSED);
182+
}
183+
176184
err_t WiFiServer::_accept(tcp_pcb* apcb, err_t err) {
177185
(void) err;
178186
DEBUGV("WS:ac\r\n");

Diff for: libraries/ESP8266WiFi/src/WiFiServer.h

+2
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,8 @@ class WiFiServer {
100100
uint16_t port() const;
101101
void close();
102102
void stop();
103+
void end();
104+
explicit operator bool();
103105

104106
using ClientType = WiFiClient;
105107

0 commit comments

Comments
 (0)