summaryrefslogtreecommitdiff
path: root/gr-zeromq/lib/rep_sink_impl.h
diff options
context:
space:
mode:
authorSylvain Munaut <tnt@246tNt.com>2016-01-27 12:58:50 +0100
committerJohnathan Corgan <johnathan@corganlabs.com>2016-01-27 10:31:26 -0800
commit6e482c5bb6bf49f000f6b8d35a1ca84127e38c46 (patch)
treeee9e4e3323da08dfabe91257229b970a38dff066 /gr-zeromq/lib/rep_sink_impl.h
parent393624c072417e0b8a74480979eeccdfb8278e77 (diff)
gr-zeromq: Big rework for performance and correctness
- Use class hierarchy trying to maximize code re-use. - Dont' drop samples on receive if the output buffer doesn't have enough space. - Don't drop tags on receive by putting tags in the future. - Better metadata creation/parsing avoiding copying lots data. - Always do as much work as possible in a single call to work() to avoid scheduler overhead as long as possible. - Allow setting the high watermark to avoid older version of zeromq's default of buffering infinite messages and causing a paging thrash to/from disk when the flow graph can't keep up. Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
Diffstat (limited to 'gr-zeromq/lib/rep_sink_impl.h')
-rw-r--r--gr-zeromq/lib/rep_sink_impl.h15
1 files changed, 4 insertions, 11 deletions
diff --git a/gr-zeromq/lib/rep_sink_impl.h b/gr-zeromq/lib/rep_sink_impl.h
index 55ebb69bfa..012fc45e7b 100644
--- a/gr-zeromq/lib/rep_sink_impl.h
+++ b/gr-zeromq/lib/rep_sink_impl.h
@@ -26,22 +26,15 @@
#include <gnuradio/zeromq/rep_sink.h>
#include <zmq.hpp>
+#include "base_impl.h"
+
namespace gr {
namespace zeromq {
- class rep_sink_impl : public rep_sink
+ class rep_sink_impl : public rep_sink, public base_sink_impl
{
- private:
- size_t d_itemsize;
- size_t d_vlen;
- int d_timeout;
- zmq::context_t *d_context;
- zmq::socket_t *d_socket;
- bool d_pass_tags;
-
public:
- rep_sink_impl(size_t itemsize, size_t vlen, char *address, int timeout, bool pass_tags);
- ~rep_sink_impl();
+ rep_sink_impl(size_t itemsize, size_t vlen, char *address, int timeout, bool pass_tags, int hwm);
int work(int noutput_items,
gr_vector_const_void_star &input_items,