summaryrefslogtreecommitdiff
path: root/src/xpub.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/xpub.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/xpub.cpp')
-rw-r--r--src/xpub.cpp23
1 files changed, 3 insertions, 20 deletions
diff --git a/src/xpub.cpp b/src/xpub.cpp
index 888b42d..d5dba9f 100644
--- a/src/xpub.cpp
+++ b/src/xpub.cpp
@@ -24,8 +24,7 @@
#include "msg.hpp"
zmq::xpub_t::xpub_t (class ctx_t *parent_, uint32_t tid_) :
- socket_base_t (parent_, tid_),
- dist (this)
+ socket_base_t (parent_, tid_)
{
options.type = ZMQ_XPUB;
}
@@ -37,35 +36,19 @@ zmq::xpub_t::~xpub_t ()
void zmq::xpub_t::xattach_pipe (pipe_t *pipe_, const blob_t &peer_identity_)
{
zmq_assert (pipe_);
- pipe_->set_event_sink (this);
dist.attach (pipe_);
}
-void zmq::xpub_t::read_activated (pipe_t *pipe_)
-{
- // PUB socket never receives messages. This should never happen.
- zmq_assert (false);
-}
-
-void zmq::xpub_t::write_activated (pipe_t *pipe_)
+void zmq::xpub_t::xwrite_activated (pipe_t *pipe_)
{
dist.activated (pipe_);
}
-void zmq::xpub_t::terminated (pipe_t *pipe_)
+void zmq::xpub_t::xterminated (pipe_t *pipe_)
{
dist.terminated (pipe_);
}
-void zmq::xpub_t::process_term (int linger_)
-{
- // Terminate the outbound pipes.
- dist.terminate ();
-
- // Continue with the termination immediately.
- socket_base_t::process_term (linger_);
-}
-
int zmq::xpub_t::xsend (msg_t *msg_, int flags_)
{
return dist.send (msg_, flags_);