commit-gnuradio
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Commit-gnuradio] [gnuradio] 37/46: zeromq: Change the value of the poll


From: git
Subject: [Commit-gnuradio] [gnuradio] 37/46: 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.
Date: Fri, 16 May 2014 19:37:17 +0000 (UTC)

This is an automated email from the git hooks/post-receive script.

jcorgan pushed a commit to branch master
in repository gnuradio.

commit aa80a7739e6885441724a776870d1b9de0183da0
Author: Johannes Schmitz <address@hidden>
Date:   Fri May 9 17:29:50 2014 +0200

    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.
---
 gr-zeromq/lib/pull_source_impl.cc | 5 +++++
 gr-zeromq/lib/push_sink_impl.cc   | 5 +++++
 gr-zeromq/lib/rep_sink_impl.cc    | 5 +++++
 gr-zeromq/lib/req_source_impl.cc  | 5 +++++
 4 files changed, 20 insertions(+)

diff --git a/gr-zeromq/lib/pull_source_impl.cc 
b/gr-zeromq/lib/pull_source_impl.cc
index 2ee6ad0..83f59c5 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;
diff --git a/gr-zeromq/lib/push_sink_impl.cc b/gr-zeromq/lib/push_sink_impl.cc
index 2f7e4ce..0b74789 100644
--- a/gr-zeromq/lib/push_sink_impl.cc
+++ b/gr-zeromq/lib/push_sink_impl.cc
@@ -43,6 +43,11 @@ namespace gr {
                        gr::io_signature::make(0, 0, 0)),
         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_PUSH);
       int time = 0;
diff --git a/gr-zeromq/lib/rep_sink_impl.cc b/gr-zeromq/lib/rep_sink_impl.cc
index 9f73fb1..181c6ba 100644
--- a/gr-zeromq/lib/rep_sink_impl.cc
+++ b/gr-zeromq/lib/rep_sink_impl.cc
@@ -43,6 +43,11 @@ namespace gr {
                        gr::io_signature::make(0, 0, 0)),
         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_REP);
       int time = 0;
diff --git a/gr-zeromq/lib/req_source_impl.cc b/gr-zeromq/lib/req_source_impl.cc
index 3cbe6ed..2e40a2e 100644
--- a/gr-zeromq/lib/req_source_impl.cc
+++ b/gr-zeromq/lib/req_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_REQ);
       int time = 0;



reply via email to

[Prev in Thread] Current Thread [Next in Thread]