1
0
mirror of https://github.com/esp8266/Arduino.git synced 2025-04-19 23:22:16 +03:00
add close and stop as alias
This commit is contained in:
Markus Sattler 2015-12-10 12:00:28 +01:00
parent 33bc6f889e
commit 55afeba174
4 changed files with 24 additions and 0 deletions

View File

@ -71,6 +71,7 @@ ESP8266WebServer::~ESP8266WebServer() {
delete handler;
handler = next;
}
close();
}
void ESP8266WebServer::begin() {
@ -173,6 +174,14 @@ void ESP8266WebServer::handleClient() {
_handleRequest();
}
void ESP8266WebServer::close() {
_server.close();
}
void ESP8266WebServer::stop() {
close();
}
void ESP8266WebServer::sendHeader(const String& name, const String& value, bool first) {
String headerLine = name;
headerLine += ": ";

View File

@ -66,6 +66,9 @@ public:
void begin();
void handleClient();
void close();
void stop();
bool authenticate(const char * username, const char * password);
void requestAuthentication();

View File

@ -121,6 +121,16 @@ uint8_t WiFiServer::status() {
return _pcb->state;
}
void WiFiServer::close() {
if (!_pcb) {
return;
}
tcp_close(_pcb);
}
void WiFiServer::stop() {
close();
}
size_t WiFiServer::write(uint8_t b) {
return write(&b, 1);

View File

@ -54,6 +54,8 @@ public:
virtual size_t write(uint8_t);
virtual size_t write(const uint8_t *buf, size_t size);
uint8_t status();
void close();
void stop();
using Print::write;