On Wed, Sep 22, 2010 at 1:16 AM, Ilja Golshtein <[email protected]> wrote:
> Hello!
>
> Please, clarify if it is Ok
>
> ==
> zmq::message_t msg;
> socket_a.recv(&msg);l

You need to do a copy of the msg before sending it the first time.
This is because a send takes ownership of your msg and actually init's
it back to 0 before it returns.  The rule we use in the Python
bindings is this: if you want to send a message other times, make sure
you do a copy before send.

> socket_b.send(msg);

> socket_c.send(msg);
> ==
> to send a message to two sockets.
>
> The same question about messages with custom deallocation function
> ==
> zmq::message_t msg(area, 1000, my_free);
>
> socket_b.send(msg);
>
> socket_c.send(msg);
> ==
>
> Thanks.
>
> --
> Best regards,
> Ilja Golshtein.
> _______________________________________________
> zeromq-dev mailing list
> [email protected]
> http://lists.zeromq.org/mailman/listinfo/zeromq-dev
>



-- 
Brian E. Granger, Ph.D.
Assistant Professor of Physics
Cal Poly State University, San Luis Obispo
[email protected]
[email protected]
_______________________________________________
zeromq-dev mailing list
[email protected]
http://lists.zeromq.org/mailman/listinfo/zeromq-dev

Reply via email to