[zeromq-dev] zmq_msg_move

KIU Shueng Chuan nixchuan at gmail.com
Mon Dec 9 15:23:40 CET 2013


1) yes, needed.
2) yes, it should. After the move, the origin message returns to an init-ed
state. You could get away with not closing, but in my opinion that relies
on knowing the underlying implementation.
3) yes. However in this case, closing the origin message is mandatory.
(Unless you also know that very short messages are copied and not shared)

It would be simpler to remember to match all inits with a corresponding
close.

I implemented a simple multi part message c++ wrapper using the move and
copy functions.
https://github.com/pijyoi/msg_parts/blob/master/msg_parts.hpp
 On Dec 9, 2013 9:35 PM, "Laurent Alebarde" <l.alebarde at free.fr> wrote:

>  Hi Devs,
>
> 1) Should zmq_msg_move be preceded by a zmq_msg_init of the dest ? Since "No
> actual copying of message content is performed, *dest* is simply updated
> to reference the new content.", I expect the answer is no.
>
>  If true, a small documentation update to precise it would be nice.
>
> 2) Should the origin message be zmq_msg_close-d after zmq_msg_move ?
>
> 3) I assume it is the same for zmq_msg_copy ?
>
> Cheers,
>
>
> Laurent
>
> _______________________________________________
> zeromq-dev mailing list
> zeromq-dev at lists.zeromq.org
> http://lists.zeromq.org/mailman/listinfo/zeromq-dev
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.zeromq.org/pipermail/zeromq-dev/attachments/20131209/5897c735/attachment.htm>


More information about the zeromq-dev mailing list