File tree 2 files changed +12
-0
lines changed
2 files changed +12
-0
lines changed Original file line number Diff line number Diff line change @@ -28,6 +28,12 @@ WiFiClient::WiFiClient(const WiFiClient& c) {
28
28
/* -------------------------------------------------------------------------- */
29
29
void WiFiClient::getSocket () {
30
30
/* -------------------------------------------------------------------------- */
31
+ if (_sock >= 0 && !connected ()) {
32
+ // if sock >= 0 -> it means we were connected, but something happened and we need
33
+ // to reset this socket in order to be able to connect again
34
+ stop ();
35
+ }
36
+
31
37
if (_sock == -1 ) {
32
38
string res = " " ;
33
39
modem.begin ();
Original file line number Diff line number Diff line change @@ -16,6 +16,12 @@ WiFiSSLClient::~WiFiSSLClient() {
16
16
/* -------------------------------------------------------------------------- */
17
17
void WiFiSSLClient::getSocket () {
18
18
/* -------------------------------------------------------------------------- */
19
+ if (_sock >= 0 && !connected ()) {
20
+ // if sock >= 0 -> it means we were connected, but something happened and we need
21
+ // to reset this socket in order to be able to connect again
22
+ stop ();
23
+ }
24
+
19
25
if (_sock == -1 ) {
20
26
string res = " " ;
21
27
modem.begin ();
You can’t perform that action at this time.
0 commit comments