File tree 1 file changed +3
-6
lines changed
1 file changed +3
-6
lines changed Original file line number Diff line number Diff line change @@ -166,8 +166,7 @@ size_t WiFiClient::write(const uint8_t *buf, size_t size)
166
166
int res = send (sockfd, (void *)buf, size, MSG_DONTWAIT);
167
167
if (res < 0 ) {
168
168
log_e (" %d" , errno);
169
- _connected = false ;
170
- sockfd = -1 ;
169
+ stop ();
171
170
res = 0 ;
172
171
}
173
172
return res;
@@ -181,8 +180,7 @@ int WiFiClient::read(uint8_t *buf, size_t size)
181
180
int res = recv (sockfd, buf, size, MSG_DONTWAIT);
182
181
if (res < 0 && errno != EWOULDBLOCK) {
183
182
log_e (" %d" , errno);
184
- _connected = false ;
185
- sockfd = -1 ;
183
+ stop ();
186
184
}
187
185
return res;
188
186
}
@@ -196,8 +194,7 @@ int WiFiClient::available()
196
194
int res = ioctl (sockfd, FIONREAD, &count);
197
195
if (res < 0 ) {
198
196
log_e (" %d" , errno);
199
- _connected = false ;
200
- sockfd = -1 ;
197
+ stop ();
201
198
return 0 ;
202
199
}
203
200
return count;
You can’t perform that action at this time.
0 commit comments