[zeromq-dev] zmq_msg_move

Laurent Alebarde l.alebarde at free.fr
Mon Dec 9 15:27:12 CET 2013


Thanks a lot Shueng Chuan. Very helpfull.

Cheers,


Laurent

Le 09/12/2013 15:23, KIU Shueng Chuan a écrit :
>
> 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 
> <mailto: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 <mailto:zeromq-dev at lists.zeromq.org>
>     http://lists.zeromq.org/mailman/listinfo/zeromq-dev
>
>
>
> _______________________________________________
> 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/0aa73949/attachment.htm>


More information about the zeromq-dev mailing list