1
0
mirror of https://github.com/esp8266/Arduino.git synced 2025-06-12 01:53:07 +03:00

WiFiClient: clean up ClientContext before connecting (#4516)

Fixes https://github.com/esp8266/Arduino/issues/4497
This commit is contained in:
Ivan Grokhotkov
2018-03-23 23:19:45 +08:00
committed by Develo
parent d5cbd91775
commit 95b1348a71

View File

@ -112,8 +112,11 @@ int WiFiClient::connect(IPAddress ip, uint16_t port)
ip_addr_t addr;
addr.addr = ip;
if (_client)
if (_client) {
stop();
_client->unref();
_client = nullptr;
}
// if the default interface is down, tcp_connect exits early without
// ever calling tcp_err