mirror of
https://github.com/0xFEEDC0DE64/arduino-esp32.git
synced 2025-07-01 13:00:59 +02:00
move call to setTimeout() to after the client connects. (#2214)
This is necessary to avoid this log entry from being generated due to invalid usage of setTimeout: [E][WiFiClient.cpp:236] setSocketOption(): 1006 : 9
This commit is contained in:
@ -966,14 +966,14 @@ bool HTTPClient::connect(void)
|
||||
return false;
|
||||
}
|
||||
|
||||
// set Timeout for WiFiClient and for Stream::readBytesUntil() and Stream::readStringUntil()
|
||||
_client->setTimeout((_tcpTimeout + 500) / 1000);
|
||||
|
||||
if(!_client->connect(_host.c_str(), _port)) {
|
||||
log_d("failed connect to %s:%u", _host.c_str(), _port);
|
||||
return false;
|
||||
}
|
||||
|
||||
// set Timeout for WiFiClient and for Stream::readBytesUntil() and Stream::readStringUntil()
|
||||
_client->setTimeout((_tcpTimeout + 500) / 1000);
|
||||
|
||||
log_d(" connected to %s:%u", _host.c_str(), _port);
|
||||
|
||||
#ifdef HTTPCLIENT_1_1_COMPATIBLE
|
||||
|
Reference in New Issue
Block a user