Skip to content

Commit d143a64

Browse files
committed
WiFiClient: implement stopAll() via stop()
1 parent 6f3785b commit d143a64

File tree

1 file changed

+5
-13
lines changed

1 file changed

+5
-13
lines changed

libraries/ESP8266WiFi/src/WiFiClient.cpp

+5-13
Original file line numberDiff line numberDiff line change
@@ -339,24 +339,16 @@ void WiFiClient::_s_err(void* arg, int8_t err)
339339
void WiFiClient::stopAll()
340340
{
341341
for (WiFiClient* it = _s_first; it; it = it->_next) {
342-
ClientContext* c = it->_client;
343-
if (c) {
344-
c->abort();
345-
c->unref();
346-
it->_client = 0;
347-
}
342+
it->stop();
348343
}
349344
}
350345

351346

352-
void WiFiClient::stopAllExcept(WiFiClient * exC) {
347+
void WiFiClient::stopAllExcept(WiFiClient* except)
348+
{
353349
for (WiFiClient* it = _s_first; it; it = it->_next) {
354-
ClientContext* c = it->_client;
355-
356-
if (c && c != exC->_client) {
357-
c->abort();
358-
c->unref();
359-
it->_client = 0;
350+
if (it != except) {
351+
it->stop();
360352
}
361353
}
362354
}

0 commit comments

Comments
 (0)