Skip to content

Commit

Permalink
WiFiServer - operator bool() and method end() (#8995)
Browse files Browse the repository at this point in the history
  • Loading branch information
JAndrassy authored Nov 4, 2023
1 parent 497dacc commit 30c6df4
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
8 changes: 8 additions & 0 deletions libraries/ESP8266WiFi/src/WiFiServer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,14 @@ void WiFiServer::stop() {
close();
}

void WiFiServer::end() {
close();
}

WiFiServer::operator bool() {
return (status() != CLOSED);
}

err_t WiFiServer::_accept(tcp_pcb* apcb, err_t err) {
(void) err;
DEBUGV("WS:ac\r\n");
Expand Down
2 changes: 2 additions & 0 deletions libraries/ESP8266WiFi/src/WiFiServer.h
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,8 @@ class WiFiServer {
uint16_t port() const;
void close();
void stop();
void end();
explicit operator bool();

using ClientType = WiFiClient;

Expand Down

0 comments on commit 30c6df4

Please sign in to comment.