[zeromq-dev] Proposal of flag in msg_t structure.

Martin Sustrik sustrik at 250bpm.com
Tue May 24 18:04:40 CEST 2011

On 05/21/2011 03:35 AM, Fabien Ninoles wrote:
>> Feature 2 - Embedded flags inside the msg_t structure.
>> By allowing frame flags to be set inside the msg_t structure, it would
>> be far easier to keep forward compatibility with new flags for proxy
>> device that need to copy msg frames in a transparent manner.  Just as an
>> example, a queue socket would simply be a while True:
>> out.send(in.recv()) loop, which will now take care of the multipart
>> flags without problem.
> How I could address this feature ?  For me, since the master branch have
> the msg_t structure opaque now,  I see it with a new API like
> zmq_msg_set_flags,  zmq_msg_reset_flags, zmq_msg_get_flags, etc. and
> removing the getsockopt ZMQ_RCVMORE.  This will break backward
> compatibility but that's already the case with the zmq_send and zmq_recv
> message.  I would keep the ZMQ_SNDMORE flag since it's feel natural
> (especially with the new zmq_send API) but will not try to clear it if
> present in the msg argument of a zmq_sendmsg, even with flag set to 0.
> What do you think about this ?

I would say: keep the existing functionality, add the now one to that.

 From API point of view, there can be for example a flag saying that 
message should be received as is:

     zmq_recv (s, &msg, ZMQ_WITH_FLAGS);

No need for API change on the send side.


More information about the zeromq-dev mailing list