summaryrefslogtreecommitdiff
path: root/src/pair.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/pair.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/pair.cpp')
-rw-r--r--src/pair.cpp31
1 files changed, 4 insertions, 27 deletions
diff --git a/src/pair.cpp b/src/pair.cpp
index 93a4327..30b56e6 100644
--- a/src/pair.cpp
+++ b/src/pair.cpp
@@ -25,8 +25,7 @@
zmq::pair_t::pair_t (class ctx_t *parent_, uint32_t tid_) :
socket_base_t (parent_, tid_),
- pipe (NULL),
- terminating (false)
+ pipe (NULL)
{
options.type = ZMQ_PAIR;
}
@@ -39,44 +38,22 @@ zmq::pair_t::~pair_t ()
void zmq::pair_t::xattach_pipe (pipe_t *pipe_, const blob_t &peer_identity_)
{
zmq_assert (!pipe);
-
pipe = pipe_;
- pipe->set_event_sink (this);
-
- if (terminating) {
- register_term_acks (1);
- pipe_->terminate ();
- }
}
-void zmq::pair_t::terminated (pipe_t *pipe_)
+void zmq::pair_t::xterminated (pipe_t *pipe_)
{
zmq_assert (pipe_ == pipe);
pipe = NULL;
-
- if (terminating)
- unregister_term_ack ();
-}
-
-void zmq::pair_t::process_term (int linger_)
-{
- terminating = true;
-
- if (pipe) {
- register_term_acks (1);
- pipe->terminate ();
- }
-
- socket_base_t::process_term (linger_);
}
-void zmq::pair_t::read_activated (pipe_t *pipe_)
+void zmq::pair_t::xread_activated (pipe_t *pipe_)
{
// There's just one pipe. No lists of active and inactive pipes.
// There's nothing to do here.
}
-void zmq::pair_t::write_activated (pipe_t *pipe_)
+void zmq::pair_t::xwrite_activated (pipe_t *pipe_)
{
// There's just one pipe. No lists of active and inactive pipes.
// There's nothing to do here.