Hi John,

> If you initialise the message empty, zmq_recvmsg will allocate
> exactly the right amount of space for you. This is ideal.
> But there's no way to get the buffer out of the msg, you have
> to copy it. This is wastes a memcpy, and wastes storage temporarily.
> You have to copy it because zmq_close will deallocate the buffer.

The problem is that 0mq messages are reference counted, so you may be 
sharing the message buffer with others.

> Of course .. you can *cheat* and simply not close the zmq_msg_t,
> and in the current implementation I am guessing this would work.

Yes. That should work.

Martin


_______________________________________________
zeromq-dev mailing list
[email protected]
http://lists.zeromq.org/mailman/listinfo/zeromq-dev

Reply via email to