summaryrefslogtreecommitdiff
path: root/src/pipe.cpp
diff options
context:
space:
mode:
authorMartin Sustrik <sustrik@250bpm.com>2010-03-27 09:24:38 +0100
committerMartin Sustrik <sustrik@250bpm.com>2010-03-27 09:24:38 +0100
commited291b02516ac5c9fe01f328d505305d36fe6319 (patch)
tree26c15f812a72bf06a05279e6629c91e7f3c41ebd /src/pipe.cpp
parent0b9897b141ae03ccd00132a638d030a2521cf5b3 (diff)
multi-part messages work with PUB/SUB
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;