Skip to content

Commit

Permalink
SocketWrapper: only retry write() if the error is NSAPI_ERROR_WOULD_B…
Browse files Browse the repository at this point in the history
…LOCK
  • Loading branch information
facchinm committed Apr 5, 2022
1 parent 7a11cf0 commit d30df6d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion libraries/SocketWrapper/src/MbedClient.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ size_t arduino::MbedClient::write(const uint8_t *buf, size_t size) {
int ret = NSAPI_ERROR_WOULD_BLOCK;
do {
ret = sock->send(buf, size);
} while (ret != size && connected());
} while ((ret != size && ret == NSAPI_ERROR_WOULD_BLOCK) && connected());
configureSocket(sock);
return size;
}
Expand Down

1 comment on commit d30df6d

@albimazzu
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If I don't make this implementation what is the potential risk?

Please sign in to comment.