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" <[email protected]> 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 > [email protected] > http://lists.zeromq.org/mailman/listinfo/zeromq-dev > >
_______________________________________________ zeromq-dev mailing list [email protected] http://lists.zeromq.org/mailman/listinfo/zeromq-dev
