Skip to content

Commit

Permalink
Do not close socket if send fails
Browse files Browse the repository at this point in the history
  • Loading branch information
giulcioffi authored and aentinger committed Jan 28, 2021
1 parent 00a6c79 commit 27ecd66
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions arduino/libraries/WiFi/src/WiFiClient.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -87,15 +87,10 @@ size_t WiFiClient::write(const uint8_t *buf, size_t size)
return 0;
}

int result = lwip_send_r(_socket, (void*)buf, size, MSG_DONTWAIT);

if (result < 0) {
lwip_close_r(_socket);
_socket = -1;
return 0;
}
int result = lwip_send_r(_socket, (void*)buf, size, MSG_PEEK);

return result;

}

int WiFiClient::available()
Expand Down

0 comments on commit 27ecd66

Please sign in to comment.