From 81c2ce0c6922fc984703bf3adeacaf73bcc3f578 Mon Sep 17 00:00:00 2001 From: Schwarzer Date: Tue, 6 Aug 2019 10:58:17 +0800 Subject: [PATCH] Add override functions for EPS32 DevKit Module in EthernetClient and EthernetServer because of the change in the Client and Server classes made by espressif. --- src/Ethernet.h | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/src/Ethernet.h b/src/Ethernet.h index 376e6c59..56114786 100644 --- a/src/Ethernet.h +++ b/src/Ethernet.h @@ -219,6 +219,18 @@ class EthernetClient : public Client { uint8_t status(); virtual int connect(IPAddress ip, uint16_t port); virtual int connect(const char *host, uint16_t port); +#ifdef ESP32 + int connect(IPAddress ip, uint16_t port, int timeout) + { + connect(ip, port); + setConnectionTimeout(timeout); + } + int connect(const char* host, uint16_t port, int timeout) + { + connect(host, port); + setConnectionTimeout(timeout); + } +#endif virtual int availableForWrite(void); virtual size_t write(uint8_t); virtual size_t write(const uint8_t *buf, size_t size); @@ -258,6 +270,12 @@ class EthernetServer : public Server { EthernetClient available(); EthernetClient accept(); virtual void begin(); +#ifdef ESP32 + void begin(uint16_t port) + { + _port = port; + } +#endif virtual size_t write(uint8_t); virtual size_t write(const uint8_t *buf, size_t size); virtual operator bool();