[zeromq-dev] Non-contiguous message thoughts

Martin Sustrik sustrik at 250bpm.com
Mon Mar 8 20:02:39 CET 2010


Michael,

>> Example of an application receiving messages consisting of two pieces:
>>
>> while (true) {
>>      zmq_recv (s, &msg1, 0);
>>      zmq_recv (s, &msg2, 0);
>>      process_it (msg1, msg2);
>> }
> 
> So am I correct in assuming the application would have to know whether the
> message is multi-part by parsing the message data?  If so, I could see this
> being a bit cumbersome.  Does it make more sense to add a field to zmq_msg_t
> to indicate whether the received message is the last of a group?

Yes. The field has to be there anyway.

We just have to find some suitable name for the accessor function...

bool zmq_msg_end (zmq_msg_t *msg);

?

Martin




More information about the zeromq-dev mailing list