From 3ace23798883fc9321a846aff30b6bf8141aa107 Mon Sep 17 00:00:00 2001 From: Simon Giesecke Date: Tue, 10 Dec 2019 16:08:52 +0100 Subject: [PATCH] Revert "Removed unreachable code paths" This reverts commit 4f77cfa3274fcddf9687fc713b8a331ee018cf87. --- src/signaler.cpp | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/src/signaler.cpp b/src/signaler.cpp index 3f22fc93..b4300d6c 100644 --- a/src/signaler.cpp +++ b/src/signaler.cpp @@ -184,10 +184,15 @@ void zmq::signaler_t::send () errno_assert (sz == sizeof (inc)); #elif defined ZMQ_HAVE_WINDOWS unsigned char dummy = 0; - const int nbytes = - ::send (_w, reinterpret_cast (&dummy), sizeof (dummy), 0); - wsa_assert (nbytes != SOCKET_ERROR); - zmq_assert (nbytes == sizeof (dummy)); + while (true) { + int nbytes = + ::send (_w, reinterpret_cast (&dummy), sizeof (dummy), 0); + wsa_assert (nbytes != SOCKET_ERROR); + if (unlikely (nbytes == SOCKET_ERROR)) + continue; + zmq_assert (nbytes == sizeof (dummy)); + break; + } #elif defined ZMQ_HAVE_VXWORKS unsigned char dummy = 0; while (true) {