From 74420db09b01872cccaeef91970906cf476a0a47 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Henrik=20=C3=96stman?= Date: Tue, 5 Jul 2022 12:12:36 +0200 Subject: [PATCH] Applied #144 https://github.com/me-no-dev/AsyncTCP/pull/144/files --- src/AsyncTCP.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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; }