summaryrefslogtreecommitdiff
path: root/src/push.cpp
diff options
context:
space:
mode:
authorMartin Sustrik <sustrik@250bpm.com>2011-05-23 20:30:01 +0200
committerMartin Sustrik <sustrik@250bpm.com>2011-05-23 20:30:01 +0200
commit0f6f7276e32c01ccfe86fb76741a52ac6ffc87af (patch)
tree3f2cec589f6243742da7e79028633d35f8b362db /src/push.cpp
parentacf0b0e515515e51ad32ba7a2d147ce703579478 (diff)
Move the pipe termination code to socket_base_t
So far, the pipe termination code was spread among socket type classes, fair queuer, load balancer, etc. This patch moves all the associated logic to a single place. Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
Diffstat (limited to 'src/push.cpp')
-rw-r--r--src/push.cpp20
1 files changed, 3 insertions, 17 deletions
diff --git a/src/push.cpp b/src/push.cpp
index 12fc8d2..44ebc07 100644
--- a/src/push.cpp
+++ b/src/push.cpp
@@ -24,8 +24,7 @@
#include "msg.hpp"
zmq::push_t::push_t (class ctx_t *parent_, uint32_t tid_) :
- socket_base_t (parent_, tid_),
- lb (this)
+ socket_base_t (parent_, tid_)
{
options.type = ZMQ_PUSH;
}
@@ -37,32 +36,19 @@ zmq::push_t::~push_t ()
void zmq::push_t::xattach_pipe (pipe_t *pipe_, const blob_t &peer_identity_)
{
zmq_assert (pipe_);
- pipe_->set_event_sink (this);
lb.attach (pipe_);
}
-void zmq::push_t::read_activated (pipe_t *pipe_)
-{
- // There are no inbound messages in push socket. This should never happen.
- zmq_assert (false);
-}
-
-void zmq::push_t::write_activated (pipe_t *pipe_)
+void zmq::push_t::xwrite_activated (pipe_t *pipe_)
{
lb.activated (pipe_);
}
-void zmq::push_t::terminated (pipe_t *pipe_)
+void zmq::push_t::xterminated (pipe_t *pipe_)
{
lb.terminated (pipe_);
}
-void zmq::push_t::process_term (int linger_)
-{
- lb.terminate ();
- socket_base_t::process_term (linger_);
-}
-
int zmq::push_t::xsend (msg_t *msg_, int flags_)
{
return lb.send (msg_, flags_);