Skip to content

Commit

Permalink
Linux: Fix stability problem with ethernet
Browse files Browse the repository at this point in the history
Fix a problem where mysgw stops working and consumes a lot of cpu.
  • Loading branch information
marceloaqno committed Mar 2, 2018
1 parent c805f77 commit ca8865d
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions drivers/Linux/EthernetServer.cpp
Expand Up @@ -155,13 +155,11 @@ size_t EthernetServer::write(uint8_t b)
size_t EthernetServer::write(const uint8_t *buffer, size_t size)
{
size_t n = 0;
size_t i = 0;

while (i < clients.size()) {
for (size_t i = 0; i < clients.size(); ++i) {
EthernetClient client(clients[i]);
if (client.status() == ETHERNETCLIENT_W5100_ESTABLISHED) {
n += client.write(buffer, size);
i++;
}
}

Expand Down

0 comments on commit ca8865d

Please sign in to comment.