diff --git a/libraries/ESP8266WiFi/src/ArduinoWiFiServer.h b/libraries/ESP8266WiFi/src/ArduinoWiFiServer.h index 53e373610e..3efb5d9f4c 100644 --- a/libraries/ESP8266WiFi/src/ArduinoWiFiServer.h +++ b/libraries/ESP8266WiFi/src/ArduinoWiFiServer.h @@ -28,7 +28,7 @@ #endif template -class ArduinoCompatibleWiFiServerTemplate : public TServer { +class ArduinoCompatibleWiFiServerTemplate : public TServer, public Print { public: ArduinoCompatibleWiFiServerTemplate(const IPAddress& addr, uint16_t port) : TServer(addr, port) {} diff --git a/libraries/ESP8266WiFi/src/WiFiServer.cpp b/libraries/ESP8266WiFi/src/WiFiServer.cpp index 30205e7cc5..7925616c2d 100644 --- a/libraries/ESP8266WiFi/src/WiFiServer.cpp +++ b/libraries/ESP8266WiFi/src/WiFiServer.cpp @@ -171,18 +171,6 @@ void WiFiServer::stop() { close(); } -size_t WiFiServer::write(uint8_t b) { - return write(&b, 1); -} - -size_t WiFiServer::write(const uint8_t *buffer, size_t size) { - // write to all clients - // not implemented - (void) buffer; - (void) size; - return 0; -} - template T* slist_append_tail(T* head, T* item) { if (!head) diff --git a/libraries/ESP8266WiFi/src/WiFiServer.h b/libraries/ESP8266WiFi/src/WiFiServer.h index 4c69868297..1bc9cf70ef 100644 --- a/libraries/ESP8266WiFi/src/WiFiServer.h +++ b/libraries/ESP8266WiFi/src/WiFiServer.h @@ -65,7 +65,7 @@ extern "C" { class ClientContext; class WiFiClient; -class WiFiServer : public Server { +class WiFiServer { // Secure server needs access to all the private entries here protected: uint16_t _port; @@ -94,14 +94,11 @@ class WiFiServer : public Server { void begin(uint16_t port, uint8_t backlog); void setNoDelay(bool nodelay); bool getNoDelay(); - virtual size_t write(uint8_t); - virtual size_t write(const uint8_t *buf, size_t size); uint8_t status(); uint16_t port() const; void close(); void stop(); - using Print::write; using ClientType = WiFiClient; protected: diff --git a/tests/host/common/MockWiFiServerSocket.cpp b/tests/host/common/MockWiFiServerSocket.cpp index 43b966d92c..9ab344bf50 100644 --- a/tests/host/common/MockWiFiServerSocket.cpp +++ b/tests/host/common/MockWiFiServerSocket.cpp @@ -127,18 +127,6 @@ bool WiFiServer::hasClient () return poll(&p, 1, 0) && p.revents == POLLIN; } -size_t WiFiServer::write (uint8_t c) -{ - return write(&c, 1); -} - -size_t WiFiServer::write (const uint8_t *buf, size_t size) -{ - fprintf(stderr, MOCK "todo: WiFiServer::write(%p, %zd)\n", buf, size); - exit(EXIT_FAILURE); - return 0; -} - void WiFiServer::close () { if (pcb2int(_listen_pcb) >= 0)