<div dir="ltr"><div class="gmail_extra">If used correctly, rabbitmq-c should not cause your program to terminate.</div><div class="gmail_extra"><br></div><div class="gmail_extra">I would need a bit more information by what you mean by "program terminated" to help you diagnose your issue. Did it segfault? Did it abort()? If so, is there a callstack indicating where this happened?</div>
<div class="gmail_extra"><br></div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Oct 9, 2013 at 5:56 AM, Lothe Shashank <span dir="ltr"><<a href="mailto:Shashank.Lothe@techmahindra.com" target="_blank">Shashank.Lothe@techmahindra.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
<div>
<div style="direction:ltr;font-size:10pt;font-family:Tahoma">1. if there is a way to check the connection before I publish<br></div></div></blockquote><div>No, and even if there was, its entirely possible that the connection could be closed between the time the program checked to see if the connection was open and the time amqp_basic_publish() was called.</div>
<div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div><div style="direction:ltr;font-size:10pt;font-family:Tahoma">
2. if the connection value becomes NULL, as we stop the broker.<br></div></div></blockquote><div>amqp_connection_state_t objects are only allocated with amqp_new_connection(), and only deallocated with amqp_destroy_connection(). No other function in rabbitmq-c should change the external facing value of an amqp_connection_state_t. Its an opaque pointer. <a href="http://stackoverflow.com/a/7553775/786714">http://stackoverflow.com/a/7553775/786714</a> for a better explanation on the pattern in use here.</div>
<div><br></div><div>-Alan</div></div></div></div>