From 3e97c0fef49e511dcae400e134876581cdae43f3 Mon Sep 17 00:00:00 2001 From: Martin Sustrik Date: Sat, 7 Aug 2010 09:52:34 +0200 Subject: REQ socket implementation is layered on top of XREQ --- src/fq.cpp | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src/fq.cpp') 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 -- cgit v1.2.3