summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMartin Sustrik <sustrik@250bpm.com>2010-09-01 07:54:57 +0200
committerMartin Sustrik <sustrik@250bpm.com>2010-09-01 07:54:57 +0200
commitaaa07613d3d7ff1eafcec3d38769f806fae5ac5c (patch)
tree6792f1227b15390e8424d16a1c6703715b724d02 /src
parent47c064f2eaa01c324e06588a4f07892762e78fcd (diff)
pipe being attached to the PAIR socket during its termination process is immediately asked to terminate itself
Diffstat (limited to 'src')
-rw-r--r--src/pair.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/pair.cpp b/src/pair.cpp
index 8db2ffc..faea167 100644
--- a/src/pair.cpp
+++ b/src/pair.cpp
@@ -44,7 +44,6 @@ zmq::pair_t::~pair_t ()
void zmq::pair_t::xattach_pipes (class reader_t *inpipe_,
class writer_t *outpipe_, const blob_t &peer_identity_)
{
- zmq_assert (!terminating);
zmq_assert (!inpipe && !outpipe);
inpipe = inpipe_;
@@ -54,6 +53,12 @@ void zmq::pair_t::xattach_pipes (class reader_t *inpipe_,
outpipe = outpipe_;
outpipe_alive = true;
outpipe->set_event_sink (this);
+
+ if (terminating) {
+ register_term_acks (2);
+ inpipe_->terminate ();
+ outpipe_->terminate ();
+ }
}
void zmq::pair_t::terminated (class reader_t *pipe_)