summaryrefslogtreecommitdiff
path: root/src/fq.cpp
diff options
context:
space:
mode:
authorMartin Sustrik <sustrik@250bpm.com>2010-08-07 09:52:34 +0200
committerMartin Sustrik <sustrik@250bpm.com>2010-08-25 15:39:20 +0200
commit3e97c0fef49e511dcae400e134876581cdae43f3 (patch)
tree700938b97f07abd668d394f177f594a0d6ea1482 /src/fq.cpp
parentf77edfce26bf50ab6eae6550d33f345c9785acca (diff)
REQ socket implementation is layered on top of XREQ
Diffstat (limited to 'src/fq.cpp')
-rw-r--r--src/fq.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/fq.cpp b/src/fq.cpp
index 48a7029..ddade28 100644
--- a/src/fq.cpp
+++ b/src/fq.cpp
@@ -46,6 +46,9 @@ void zmq::fq_t::attach (reader_t *pipe_)
void zmq::fq_t::terminated (reader_t *pipe_)
{
+ // TODO: This is a problem with session-initiated termination. It breaks
+ // message atomicity. However, for socket initiated termination it's
+ // just fine.
zmq_assert (!more || pipes [current] != pipe_);
// Remove the pipe from the list; adjust number of active pipes
@@ -87,6 +90,10 @@ int zmq::fq_t::recv (zmq_msg_t *msg_, int flags_)
// Try to fetch new message. If we've already read part of the message
// subsequent part should be immediately available.
bool fetched = pipes [current]->read (msg_);
+
+ // Check the atomicity of the message. If we've already received the
+ // first part of the message we should get the remaining parts
+ // without blocking.
zmq_assert (!(more && !fetched));
// Note that when message is not fetched, current pipe is killed and