Skip to content
Permalink
Browse files

Linux: Fix stability problem with ethernet

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 ca8865d8e1fe1b08195943fae1640d5fddb81924
Showing with 1 addition and 3 deletions.
  1. +1 −3 drivers/Linux/EthernetServer.cpp
@@ -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++;
}
}

0 comments on commit ca8865d

Please sign in to comment.
You can’t perform that action at this time.