Merge pull request #2360 from nexcvon/patch-2

Problem: Assertion failed in zmq::signaler_t::send
This commit is contained in:
Luca Boccassi 2017-03-03 13:13:07 +00:00 committed by GitHub
commit 34be53d8e4

View File

@ -187,9 +187,13 @@ void zmq::signaler_t::send ()
errno_assert (sz == sizeof (inc));
#elif defined ZMQ_HAVE_WINDOWS
unsigned char dummy = 0;
int nbytes = ::send (w, (char *) &dummy, sizeof (dummy), 0);
wsa_assert (nbytes != SOCKET_ERROR);
zmq_assert (nbytes == sizeof (dummy));
while (true) {
int nbytes = ::send (w, (char*) &dummy, sizeof (dummy), 0);
if (unlikely (nbytes == SOCKET_ERROR))
continue;
zmq_assert (nbytes == sizeof (dummy));
break;
}
#else
unsigned char dummy = 0;
while (true) {