@@ -61,12 +61,6 @@ int WiFiClient::connect(IPAddress ip, uint16_t port) {
61
61
{
62
62
ServerDrv::startClient (uint32_t (ip), port, _sock);
63
63
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
-
70
64
if (!connected ())
71
65
{
72
66
return 0 ;
@@ -90,12 +84,6 @@ int WiFiClient::connectSSL(IPAddress ip, uint16_t port)
90
84
{
91
85
ServerDrv::startClient (uint32_t (ip), port, _sock, TLS_MODE);
92
86
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
-
99
87
if (!connected ())
100
88
{
101
89
return 0 ;
@@ -119,12 +107,6 @@ int WiFiClient::connectSSL(const char *host, uint16_t port)
119
107
{
120
108
ServerDrv::startClient (host, strlen (host), uint32_t (0 ), port, _sock, TLS_MODE);
121
109
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
-
128
110
if (!connected ())
129
111
{
130
112
return 0 ;
@@ -148,12 +130,6 @@ int WiFiClient::connectBearSSL(IPAddress ip, uint16_t port)
148
130
{
149
131
ServerDrv::startClient (uint32_t (ip), port, _sock, TLS_BEARSSL_MODE);
150
132
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
-
157
133
if (!connected ())
158
134
{
159
135
return 0 ;
@@ -177,12 +153,6 @@ int WiFiClient::connectBearSSL(const char *host, uint16_t port)
177
153
{
178
154
ServerDrv::startClient (host, strlen (host), uint32_t (0 ), port, _sock, TLS_BEARSSL_MODE);
179
155
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
-
186
156
if (!connected ())
187
157
{
188
158
return 0 ;
0 commit comments