diff options
author | Johannes Schmitz <schmitz@ti.rwth-aachen.de> | 2014-05-09 17:29:50 +0200 |
---|---|---|
committer | Johannes Schmitz <schmitz@ti.rwth-aachen.de> | 2014-05-09 17:29:50 +0200 |
commit | aa80a7739e6885441724a776870d1b9de0183da0 (patch) | |
tree | f376d6e124c6f2a703221cec82d01b2b9ae05a46 /gr-zeromq/lib/pull_source_impl.cc | |
parent | 9ee2cca0813bcbdd3537eba01f7b8e08b2007790 (diff) |
zeromq: Change the value of the poll timeout according to the zmq version.
Must be in microseconds for version 2 and below and in milliseconds for
version 3 and above.
Diffstat (limited to 'gr-zeromq/lib/pull_source_impl.cc')
-rw-r--r-- | gr-zeromq/lib/pull_source_impl.cc | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/gr-zeromq/lib/pull_source_impl.cc b/gr-zeromq/lib/pull_source_impl.cc index 2ee6ad08c8..83f59c5c76 100644 --- a/gr-zeromq/lib/pull_source_impl.cc +++ b/gr-zeromq/lib/pull_source_impl.cc @@ -43,6 +43,11 @@ namespace gr { gr::io_signature::make(1, 1, itemsize * vlen)), d_itemsize(itemsize), d_vlen(vlen), d_timeout(timeout) { + int major, minor, patch; + zmq::version (&major, &minor, &patch); + if (major < 3) { + d_timeout = timeout*1000; + } d_context = new zmq::context_t(1); d_socket = new zmq::socket_t(*d_context, ZMQ_PULL); int time = 0; |