Linux: Fix stability problem with ethernet (#1091)

- Fix a problem where mysgw stops working and consumes a lot of cpu.
- Fix bug with tcp sockets where socket descriptor wasn't being
  freed.
This commit is contained in:
Marcelo Aquino
2018-03-24 08:16:44 +01:00
committed by Mikael Falkvidd
parent 2175c993ef
commit ea6d07cb79
2 changed files with 4 additions and 9 deletions
+1 -3
View File
@@ -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++;
}
}