mirror of
https://github.com/esp8266/Arduino.git
synced 2025-04-19 23:22:16 +03:00
parent
33bc6f889e
commit
55afeba174
@ -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 += ": ";
|
||||
|
@ -66,6 +66,9 @@ public:
|
||||
void begin();
|
||||
void handleClient();
|
||||
|
||||
void close();
|
||||
void stop();
|
||||
|
||||
bool authenticate(const char * username, const char * password);
|
||||
void requestAuthentication();
|
||||
|
||||
|
@ -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);
|
||||
|
@ -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;
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user