On Thu, Nov 29, 2012 at 3:25 PM, Kah-Chan Low <[email protected]> wrote:

> Doesn't zmq_send(), which is called by socket_t::send(), make a copy of
> whatever message that is passed in before returning?

It takes the buffer you provide and queues that address for sending.
It's confusing you because you think the pointer is passed by value
whereas you are passing its address, precisely as if it was a buffer.
This is a fairly common error for beginners, to pass a buffer that is
deallocated before the send completes.

(I've not tried to reproduce it but this is what I believe is happening.)

Try just sending one pointer (not in a loop).

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

Reply via email to