Skip to content

Commit 684b5f1

Browse files
committed
WiFiClient: set default timeout to 5000ms for compatibility
1 parent 7151265 commit 684b5f1

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

libraries/ESP8266WiFi/src/WiFiClient.cpp

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,12 +48,13 @@ WiFiClient* SList<WiFiClient>::_s_first = 0;
4848

4949

5050
WiFiClient::WiFiClient()
51-
: _client(0)
51+
: _client(0), _timeout(5000)
5252
{
5353
WiFiClient::_add(this);
5454
}
5555

56-
WiFiClient::WiFiClient(ClientContext* client) : _client(client)
56+
WiFiClient::WiFiClient(ClientContext* client)
57+
: _client(client), _timeout(5000)
5758
{
5859
_client->ref();
5960
WiFiClient::_add(this);
@@ -69,6 +70,8 @@ WiFiClient::~WiFiClient()
6970
WiFiClient::WiFiClient(const WiFiClient& other)
7071
{
7172
_client = other._client;
73+
_timeout = other._timeout;
74+
_localPort = other._localPort;
7275
if (_client)
7376
_client->ref();
7477
WiFiClient::_add(this);
@@ -79,6 +82,8 @@ WiFiClient& WiFiClient::operator=(const WiFiClient& other)
7982
if (_client)
8083
_client->unref();
8184
_client = other._client;
85+
_timeout = other._timeout;
86+
_localPort = other._localPort;
8287
if (_client)
8388
_client->ref();
8489
return *this;

0 commit comments

Comments
 (0)