summaryrefslogtreecommitdiff
path: root/src/zmq.cpp
diff options
context:
space:
mode:
authorMartin Sustrik <sustrik@250bpm.com>2011-03-23 15:50:18 +0100
committerMartin Sustrik <sustrik@250bpm.com>2011-03-23 15:50:18 +0100
commitf5e6d67948b8c71c2444046f6246aebab16546dc (patch)
treefdf354c520b18d0395d39f001ca4da646e6fc698 /src/zmq.cpp
parente3cf6e9ced979464d30ad4cd63087cfbee33e9bd (diff)
Timeout in zmq_poll is in milliseconds
The old timeout in microsecond haven't been compliant with POSIX and was impractical at the same time. Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
Diffstat (limited to 'src/zmq.cpp')
-rw-r--r--src/zmq.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/zmq.cpp b/src/zmq.cpp
index 929e51c..5029734 100644
--- a/src/zmq.cpp
+++ b/src/zmq.cpp
@@ -387,10 +387,10 @@ int zmq_poll (zmq_pollitem_t *items_, int nitems_, long timeout_)
if (timeout_ == 0)
return 0;
#if defined ZMQ_HAVE_WINDOWS
- Sleep (timeout_ > 0 ? timeout_ / 1000 : INFINITE);
+ Sleep (timeout_ > 0 ? timeout_ : INFINITE);
return 0;
#else
- return usleep (timeout_);
+ return usleep (timeout_ * 1000);
#endif
}
@@ -514,7 +514,7 @@ int zmq_poll (zmq_pollitem_t *items_, int nitems_, long timeout_)
// when the polling should time out.
if (first_pass) {
now = clock.now_ms ();
- end = now + (timeout_ / 1000);
+ end = now + timeout_;
if (now == end)
break;
first_pass = false;
@@ -540,10 +540,10 @@ int zmq_poll (zmq_pollitem_t *items_, int nitems_, long timeout_)
if (timeout_ == 0)
return 0;
#if defined ZMQ_HAVE_WINDOWS
- Sleep (timeout_ > 0 ? timeout_ / 1000 : INFINITE);
+ Sleep (timeout_ > 0 ? timeout_ : INFINITE);
return 0;
#else
- return usleep (timeout_);
+ return usleep (timeout_ * 1000);
#endif
}
@@ -695,7 +695,7 @@ int zmq_poll (zmq_pollitem_t *items_, int nitems_, long timeout_)
// when the polling should time out.
if (first_pass) {
now = clock.now_ms ();
- end = now + (timeout_ / 1000);
+ end = now + timeout_;
if (now == end)
break;
first_pass = false;