summaryrefslogtreecommitdiff
path: root/src/xreq.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/xreq.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/xreq.cpp')
-rw-r--r--src/xreq.cpp28
1 files changed, 14 insertions, 14 deletions
diff --git a/src/xreq.cpp b/src/xreq.cpp
index d359dc0..9b95393 100644
--- a/src/xreq.cpp
+++ b/src/xreq.cpp
@@ -21,7 +21,6 @@
#include "xreq.hpp"
#include "err.hpp"
-#include "pipe.hpp"
zmq::xreq_t::xreq_t (class app_thread_t *parent_) :
socket_base_t (parent_)
@@ -37,27 +36,31 @@ zmq::xreq_t::~xreq_t ()
void zmq::xreq_t::xattach_pipes (class reader_t *inpipe_,
class writer_t *outpipe_)
{
- zmq_assert (false);
+ zmq_assert (inpipe_ && outpipe_);
+ fq.attach (inpipe_);
+ lb.attach (outpipe_);
}
void zmq::xreq_t::xdetach_inpipe (class reader_t *pipe_)
{
- zmq_assert (false);
+ zmq_assert (pipe_);
+ fq.detach (pipe_);
}
void zmq::xreq_t::xdetach_outpipe (class writer_t *pipe_)
{
- zmq_assert (false);
+ zmq_assert (pipe_);
+ lb.detach (pipe_);
}
void zmq::xreq_t::xkill (class reader_t *pipe_)
{
- zmq_assert (false);
+ fq.kill (pipe_);
}
void zmq::xreq_t::xrevive (class reader_t *pipe_)
{
- zmq_assert (false);
+ fq.revive (pipe_);
}
int zmq::xreq_t::xsetsockopt (int option_, const void *optval_,
@@ -69,32 +72,29 @@ int zmq::xreq_t::xsetsockopt (int option_, const void *optval_,
int zmq::xreq_t::xsend (zmq_msg_t *msg_, int flags_)
{
- zmq_assert (false);
- return -1;
+ return lb.send (msg_, flags_);
}
int zmq::xreq_t::xflush ()
{
+ // TODO: Implement flushing.
zmq_assert (false);
return -1;
}
int zmq::xreq_t::xrecv (zmq_msg_t *msg_, int flags_)
{
- zmq_assert (false);
- return -1;
+ return fq.recv (msg_, flags_);
}
bool zmq::xreq_t::xhas_in ()
{
- zmq_assert (false);
- return false;
+ return fq.has_in ();
}
bool zmq::xreq_t::xhas_out ()
{
- zmq_assert (false);
- return false;
+ return lb.has_out ();
}