summaryrefslogtreecommitdiff
path: root/src/xrep.cpp
diff options
context:
space:
mode:
authorMartin Sustrik <sustrik@fastmq.commkdir>2009-12-15 09:09:19 +0100
committerMartin Sustrik <sustrik@fastmq.commkdir>2009-12-15 09:09:19 +0100
commite49115224a7957b0e5d49326bc02ae6af186eaf9 (patch)
tree81d1ca0ea496004bbc85cec9b3289af96cdaa197 /src/xrep.cpp
parentbd792faa9d6c78c375dbc52c6d773e157335da36 (diff)
zmq_encoder/decoder are able to add/trim prefixes from messages; fair queueing and load balancing algorithms factorised into separate classes
Diffstat (limited to 'src/xrep.cpp')
-rw-r--r--src/xrep.cpp17
1 files changed, 9 insertions, 8 deletions
diff --git a/src/xrep.cpp b/src/xrep.cpp
index 1b6a536..4fa250b 100644
--- a/src/xrep.cpp
+++ b/src/xrep.cpp
@@ -21,7 +21,6 @@
#include "xrep.hpp"
#include "err.hpp"
-#include "pipe.hpp"
zmq::xrep_t::xrep_t (class app_thread_t *parent_) :
socket_base_t (parent_)
@@ -37,12 +36,16 @@ zmq::xrep_t::~xrep_t ()
void zmq::xrep_t::xattach_pipes (class reader_t *inpipe_,
class writer_t *outpipe_)
{
+ zmq_assert (inpipe_ && outpipe_);
+ fq.attach (inpipe_);
+
zmq_assert (false);
}
void zmq::xrep_t::xdetach_inpipe (class reader_t *pipe_)
{
- zmq_assert (false);
+ zmq_assert (pipe_);
+ fq.detach (pipe_);
}
void zmq::xrep_t::xdetach_outpipe (class writer_t *pipe_)
@@ -52,12 +55,12 @@ void zmq::xrep_t::xdetach_outpipe (class writer_t *pipe_)
void zmq::xrep_t::xkill (class reader_t *pipe_)
{
- zmq_assert (false);
+ fq.kill (pipe_);
}
void zmq::xrep_t::xrevive (class reader_t *pipe_)
{
- zmq_assert (false);
+ fq.revive (pipe_);
}
int zmq::xrep_t::xsetsockopt (int option_, const void *optval_,
@@ -81,14 +84,12 @@ int zmq::xrep_t::xflush ()
int zmq::xrep_t::xrecv (zmq_msg_t *msg_, int flags_)
{
- zmq_assert (false);
- return -1;
+ return fq.recv (msg_, flags_);
}
bool zmq::xrep_t::xhas_in ()
{
- zmq_assert (false);
- return false;
+ return fq.has_in ();
}
bool zmq::xrep_t::xhas_out ()