Skip to content

Commit 9c64c96

Browse files
committed
WiFiClient - remove timeouts after startClient fw call
startClient is blocking in firmware. if it timed out it doesn't make sense to wait additional 10 seconds
1 parent 8816d8a commit 9c64c96

File tree

1 file changed

+0
-30
lines changed

1 file changed

+0
-30
lines changed

src/WiFiClient.cpp

Lines changed: 0 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -61,12 +61,6 @@ int WiFiClient::connect(IPAddress ip, uint16_t port) {
6161
{
6262
ServerDrv::startClient(uint32_t(ip), port, _sock);
6363

64-
unsigned long start = millis();
65-
66-
// wait 4 second for the connection to close
67-
while (!connected() && millis() - start < 10000)
68-
delay(1);
69-
7064
if (!connected())
7165
{
7266
return 0;
@@ -90,12 +84,6 @@ int WiFiClient::connectSSL(IPAddress ip, uint16_t port)
9084
{
9185
ServerDrv::startClient(uint32_t(ip), port, _sock, TLS_MODE);
9286

93-
unsigned long start = millis();
94-
95-
// wait 4 second for the connection to close
96-
while (!connected() && millis() - start < 10000)
97-
delay(1);
98-
9987
if (!connected())
10088
{
10189
return 0;
@@ -119,12 +107,6 @@ int WiFiClient::connectSSL(const char *host, uint16_t port)
119107
{
120108
ServerDrv::startClient(host, strlen(host), uint32_t(0), port, _sock, TLS_MODE);
121109

122-
unsigned long start = millis();
123-
124-
// wait 4 second for the connection to close
125-
while (!connected() && millis() - start < 10000)
126-
delay(1);
127-
128110
if (!connected())
129111
{
130112
return 0;
@@ -148,12 +130,6 @@ int WiFiClient::connectBearSSL(IPAddress ip, uint16_t port)
148130
{
149131
ServerDrv::startClient(uint32_t(ip), port, _sock, TLS_BEARSSL_MODE);
150132

151-
unsigned long start = millis();
152-
153-
// wait 4 second for the connection to close
154-
while (!connected() && millis() - start < 10000)
155-
delay(1);
156-
157133
if (!connected())
158134
{
159135
return 0;
@@ -177,12 +153,6 @@ int WiFiClient::connectBearSSL(const char *host, uint16_t port)
177153
{
178154
ServerDrv::startClient(host, strlen(host), uint32_t(0), port, _sock, TLS_BEARSSL_MODE);
179155

180-
unsigned long start = millis();
181-
182-
// wait 4 second for the connection to close
183-
while (!connected() && millis() - start < 10000)
184-
delay(1);
185-
186156
if (!connected())
187157
{
188158
return 0;

0 commit comments

Comments
 (0)