Am 12.11.2010 12:00, schrieb Christian Gudrian:

> What about something like this:

Sorry, I've forgotten the "else":

diff --git a/src/mailbox.cpp b/src/mailbox.cpp
index c186007..827326c 100644
--- a/src/mailbox.cpp
+++ b/src/mailbox.cpp
@@ -73,7 +73,15 @@ void zmq::mailbox_t::send (const command_t &cmd_)
     //  TODO: Implement SNDBUF auto-resizing as for POSIX platforms.
     //  In the mean time, the following code with assert if the send()
     //  call would block.
-    int nbytes = ::send (w, (char *)&cmd_, sizeof (command_t), 0);
+    int nbytes;
+    while (true)
+    {
+        nbytes = ::send (w, (char *)&cmd_, sizeof (command_t), 0);
+        if ((nbytes == SOCKET_ERROR) && (GetLastError () == WSAEWOULDBLOCK))
+            Sleep (1);
+        else
+            break;
+    }
     wsa_assert (nbytes != SOCKET_ERROR);
     zmq_assert (nbytes == sizeof (command_t));
 }

Christian
_______________________________________________
zeromq-dev mailing list
zeromq-dev@lists.zeromq.org
http://lists.zeromq.org/mailman/listinfo/zeromq-dev

Reply via email to