Skip to content

Commit f7d9db9

Browse files
committed
MbedClient: do not retry writes
1 parent 4883879 commit f7d9db9

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

libraries/SocketWrapper/src/MbedClient.cpp

+2-5
Original file line numberDiff line numberDiff line change
@@ -215,12 +215,9 @@ size_t arduino::MbedClient::write(const uint8_t *buf, size_t size) {
215215

216216
sock->set_blocking(true);
217217
sock->set_timeout(SOCKET_TIMEOUT);
218-
int ret = NSAPI_ERROR_WOULD_BLOCK;
219-
do {
220-
ret = sock->send(buf, size);
221-
} while ((ret != size && ret == NSAPI_ERROR_WOULD_BLOCK) && connected());
218+
int ret = sock->send(buf, size);
222219
sock->set_blocking(false);
223-
return size;
220+
return ret >= 0 ? ret : 0;
224221
}
225222

226223
int arduino::MbedClient::available() {

0 commit comments

Comments
 (0)