8 zmq::rep_t::rep_t (
class ctx_t *parent_, uint32_t tid_,
int sid_) :
9 router_t (parent_, tid_, sid_),
10 _sending_reply (
false),
11 _request_begins (
true)
20 int zmq::rep_t::xsend (msg_t *msg_)
23 if (!_sending_reply) {
28 const bool more = (msg_->flags () & msg_t::more) != 0;
31 const int rc = router_t::xsend (msg_);
37 _sending_reply =
false;
42 int zmq::rep_t::xrecv (msg_t *msg_)
52 if (_request_begins) {
54 int rc = router_t::xrecv (msg_);
58 if ((msg_->flags () & msg_t::more)) {
60 const bool bottom = (msg_->size () == 0);
63 rc = router_t::xsend (msg_);
71 rc = router_t::rollback ();
75 _request_begins =
false;
79 const int rc = router_t::xrecv (msg_);
84 if (!(msg_->flags () & msg_t::more)) {
85 _sending_reply =
true;
86 _request_begins =
true;
92 bool zmq::rep_t::xhas_in ()
97 return router_t::xhas_in ();
100 bool zmq::rep_t::xhas_out ()
105 return router_t::xhas_out ();