| 21 | } |
| 22 | |
| 23 | int EthernetClient::connect(const char* host, uint16_t port) { |
| 24 | // Look up the host first |
| 25 | int ret = 0; |
| 26 | DNSClient dns; |
| 27 | IPAddress remote_addr; |
| 28 | |
| 29 | dns.begin(Ethernet.dnsServerIP()); |
| 30 | ret = dns.getHostByName(host, remote_addr); |
| 31 | if (ret == 1) { |
| 32 | return connect(remote_addr, port); |
| 33 | } else { |
| 34 | return ret; |
| 35 | } |
| 36 | } |
| 37 | |
| 38 | int EthernetClient::connect(IPAddress ip, uint16_t port) { |
| 39 | if (_sock != MAX_SOCK_NUM) |
no test coverage detected