@@ -63,9 +63,12 @@ int WiFiClient::connect(IPAddress ip, uint16_t port) {
63
63
64
64
unsigned long start = millis ();
65
65
66
- // wait 4 second for the connection to close
66
+ // wait 10 second for the connection to close
67
67
while (!connected () && millis () - start < 10000 )
68
+ {
68
69
delay (1 );
70
+ WiFi.feedWatchdog ();
71
+ }
69
72
70
73
if (!connected ())
71
74
{
@@ -92,9 +95,12 @@ int WiFiClient::connectSSL(IPAddress ip, uint16_t port)
92
95
93
96
unsigned long start = millis ();
94
97
95
- // wait 4 second for the connection to close
98
+ // wait 10 second for the connection to close
96
99
while (!connected () && millis () - start < 10000 )
97
- delay (1 );
100
+ {
101
+ delay (1 );
102
+ WiFi.feedWatchdog ();
103
+ }
98
104
99
105
if (!connected ())
100
106
{
@@ -121,9 +127,12 @@ int WiFiClient::connectSSL(const char *host, uint16_t port)
121
127
122
128
unsigned long start = millis ();
123
129
124
- // wait 4 second for the connection to close
130
+ // wait 10 second for the connection to close
125
131
while (!connected () && millis () - start < 10000 )
126
- delay (1 );
132
+ {
133
+ delay (1 );
134
+ WiFi.feedWatchdog ();
135
+ }
127
136
128
137
if (!connected ())
129
138
{
@@ -150,9 +159,12 @@ int WiFiClient::connectBearSSL(IPAddress ip, uint16_t port)
150
159
151
160
unsigned long start = millis ();
152
161
153
- // wait 4 second for the connection to close
162
+ // wait 10 second for the connection to close
154
163
while (!connected () && millis () - start < 10000 )
155
- delay (1 );
164
+ {
165
+ delay (1 );
166
+ WiFi.feedWatchdog ();
167
+ }
156
168
157
169
if (!connected ())
158
170
{
@@ -179,9 +191,12 @@ int WiFiClient::connectBearSSL(const char *host, uint16_t port)
179
191
180
192
unsigned long start = millis ();
181
193
182
- // wait 4 second for the connection to close
194
+ // wait 10 second for the connection to close
183
195
while (!connected () && millis () - start < 10000 )
184
- delay (1 );
196
+ {
197
+ delay (1 );
198
+ WiFi.feedWatchdog ();
199
+ }
185
200
186
201
if (!connected ())
187
202
{
@@ -301,7 +316,10 @@ void WiFiClient::stop() {
301
316
int count = 0 ;
302
317
// wait maximum 5 secs for the connection to close
303
318
while (status () != CLOSED && ++count < 50 )
304
- delay (100 );
319
+ {
320
+ delay (100 );
321
+ WiFi.feedWatchdog ();
322
+ }
305
323
306
324
WiFiSocketBuffer.close (_sock);
307
325
_sock = 255 ;
0 commit comments