diff --git a/src/AsyncTCP.cpp b/src/AsyncTCP.cpp index 89ff6ee..58f99ed 100644 --- a/src/AsyncTCP.cpp +++ b/src/AsyncTCP.cpp @@ -1017,9 +1017,12 @@ size_t AsyncClient::write(const char* data) { size_t AsyncClient::write(const char* data, size_t size, uint8_t apiflags) { size_t will_send = add(data, size, apiflags); - if(!will_send || !send()) { + if (!will_send) { return 0; } + while (connected() && !send()) { + taskYIELD(); + } return will_send; }