Skip to content

Commit

Permalink
[TEMP] MbedClient: retry write if modem returns NSAPI_ERROR_WOULD_BLOCK
Browse files Browse the repository at this point in the history
This should be handled in modem driver because it was intentionally removed in
#906
  • Loading branch information
pennam committed Oct 16, 2024
1 parent 5fa067e commit 3fe32be
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion libraries/SocketWrapper/src/MbedClient.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,10 @@ size_t arduino::MbedClient::write(const uint8_t *buf, size_t size) {
return 0;

sock->set_timeout(_timeout);
int ret = sock->send(buf, size);
int ret = NSAPI_ERROR_WOULD_BLOCK;
do {
ret = sock->send(buf, size);
} while ((ret != size && ret == NSAPI_ERROR_WOULD_BLOCK) && connected());
sock->set_blocking(false);
return ret >= 0 ? ret : 0;
}
Expand Down

0 comments on commit 3fe32be

Please sign in to comment.