On Fri, Jan 25, 2013 at 9:53 PM, Paul O'Fallon <[email protected]>wrote:
> Hello! I'm new to proton (and AMQP), and have some questions about using > the Messenger API in the C library to send messages to Windows Azure. I've > noticed that it takes three steps before a message is actually sent (i.e. > before it is fetched when running the 'recv' command line example). I call > pn_messenger_put(), pn_messenger_send(), and then pn_messenger_stop(). My > question is about the third call -- to pn_messenger_stop(). If I omit that > and just call the first two, the message is not actually sent. > > My concern is whether calling stop() after every send will be a problem in > the case where I want to use the same instance of messenger to call recv() > in a separate thread. The API docs state "A messenger cannot send or recv > messages when it is stopped.". > > So, two questions: > > (1) Is the need to call stop() after each send() expected behavior? > I wouldn't expect that you need to call stop() after each send(), however you should call it before exiting the program. Do you have a code fragment you could post that reproduces the behaviour you're seeing? It sounds like it could be a bug, if it is what I suspect you could try working around it by setting a positive outgoing window. > (2) Will repeatedly calling stop() affect the recv() running in the > separate thread? > Are you sharing a single messenger between the two threads? --Rafael
