mirror of
https://github.com/esp8266/Arduino.git
synced 2025-07-30 16:24:09 +03:00
Proposed fix for issue 243, adding DNS to the Ethernet library. Uses a slightly modified version of the agreed API as the host/port parameters have been moved from the Client constructor to the Client::connect methods. This means it's possible for errors to be returned if the DNS lookup fails and also reduces the RAM footprint of the Client class as it no longer needs to store the host/port for later use in Client::connect.
This commit is contained in:
@ -8,10 +8,10 @@ class Client : public Stream {
|
||||
public:
|
||||
Client();
|
||||
Client(uint8_t sock);
|
||||
Client(IPAddress& ip, uint16_t port);
|
||||
|
||||
uint8_t status();
|
||||
uint8_t connect();
|
||||
int connect(IPAddress ip, uint16_t port);
|
||||
int connect(const char *host, uint16_t port);
|
||||
virtual void write(uint8_t);
|
||||
virtual void write(const char *str);
|
||||
virtual void write(const uint8_t *buf, size_t size);
|
||||
@ -29,8 +29,6 @@ public:
|
||||
private:
|
||||
static uint16_t _srcport;
|
||||
uint8_t _sock;
|
||||
IPAddress _ip;
|
||||
uint16_t _port;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
Reference in New Issue
Block a user