Skip to content

Commit d30df6d

Browse files
committed
SocketWrapper: only retry write() if the error is NSAPI_ERROR_WOULD_BLOCK
1 parent 7a11cf0 commit d30df6d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

libraries/SocketWrapper/src/MbedClient.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,7 @@ size_t arduino::MbedClient::write(const uint8_t *buf, size_t size) {
213213
int ret = NSAPI_ERROR_WOULD_BLOCK;
214214
do {
215215
ret = sock->send(buf, size);
216-
} while (ret != size && connected());
216+
} while ((ret != size && ret == NSAPI_ERROR_WOULD_BLOCK) && connected());
217217
configureSocket(sock);
218218
return size;
219219
}

0 commit comments

Comments
 (0)