You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@qpid.apache.org by TonyErcolano <to...@microsoft.com> on 2015/05/26 03:58:46 UTC

When may I use pn_message_free?

Given that I have a well formed message,

If I have the following snippet:

pn_messenger_put(myMessenger, myMessage);
pn_message_clear(myMessage);
//
// More code here that sets up new message stuff in myMessage
//
pn_messenger_put(myMessenger, myMessage);
pn_messenger_send(myMessenger, -1);

Will the first message and second messages be successfully sent?
It isn't quite clear from the doc's whether everything about a message is
"captured" by the put.

Thank you,
Tony



--
View this message in context: http://qpid.2158936.n2.nabble.com/When-may-I-use-pn-message-free-tp7625284.html
Sent from the Apache Qpid users mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@qpid.apache.org
For additional commands, e-mail: users-help@qpid.apache.org


Re: When may I use pn_message_free?

Posted by Rafael Schloming <rh...@alum.mit.edu>.
The pn_messenger_put(...) call will copy the message contents, so both the
first and second message should be sent successfully in your example
snippet.

--Rafael

On Mon, May 25, 2015 at 9:58 PM, TonyErcolano <to...@microsoft.com>
wrote:

> Given that I have a well formed message,
>
> If I have the following snippet:
>
> pn_messenger_put(myMessenger, myMessage);
> pn_message_clear(myMessage);
> //
> // More code here that sets up new message stuff in myMessage
> //
> pn_messenger_put(myMessenger, myMessage);
> pn_messenger_send(myMessenger, -1);
>
> Will the first message and second messages be successfully sent?
> It isn't quite clear from the doc's whether everything about a message is
> "captured" by the put.
>
> Thank you,
> Tony
>
>
>
> --
> View this message in context:
> http://qpid.2158936.n2.nabble.com/When-may-I-use-pn-message-free-tp7625284.html
> Sent from the Apache Qpid users mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@qpid.apache.org
> For additional commands, e-mail: users-help@qpid.apache.org
>
>