summaryrefslogtreecommitdiff
path: root/src/pipe.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/pipe.cpp')
-rw-r--r--src/pipe.cpp10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/pipe.cpp b/src/pipe.cpp
index 14a6ef4..e844865 100644
--- a/src/pipe.cpp
+++ b/src/pipe.cpp
@@ -77,7 +77,9 @@ bool zmq::reader_t::read (zmq_msg_t *msg_)
return false;
}
- msgs_read++;
+ if (!(msg_->flags & ZMQ_MSG_TBC))
+ msgs_read++;
+
if (lwm > 0 && msgs_read % lwm == 0)
send_reader_info (peer, msgs_read);
@@ -161,7 +163,8 @@ bool zmq::writer_t::write (zmq_msg_t *msg_)
}
pipe->write (*msg_);
- msgs_written++;
+ if (!(msg_->flags & ZMQ_MSG_TBC))
+ msgs_written++;
return true;
}
@@ -194,6 +197,9 @@ void zmq::writer_t::term ()
{
endpoint = NULL;
+ // Rollback any unfinished messages.
+ rollback ();
+
// Push delimiter into the pipe.
// Trick the compiler to belive that the tag is a valid pointer.
zmq_msg_t msg;