<div dir="ltr">Also note that I&#39;m currently working on documenting rabbitmq-c, so hopefully in the near-ish future there will be some &#39;best practices&#39; on how to do all of this.<div><br></div><div>You can find further details on progress here:</div>
<div><a href="https://github.com/alanxz/rabbitmq-c/pull/61">https://github.com/alanxz/rabbitmq-c/pull/61</a><br></div><div><br></div><div>-Alan</div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Mon, Jul 22, 2013 at 9:24 AM, Alan Antonuk <span dir="ltr">&lt;<a href="mailto:alan.antonuk@gmail.com" target="_blank">alan.antonuk@gmail.com</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">This should really go to the whole list....<div><div class="h5"><div class="gmail_extra"><br><br><div class="gmail_quote">
On Mon, Jul 22, 2013 at 9:21 AM, Alan Antonuk <span dir="ltr">&lt;<a href="mailto:alan.antonuk@gmail.com" target="_blank">alan.antonuk@gmail.com</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div>On Mon, Jul 22, 2013 at 12:29 AM, Matthias Radestock <span dir="ltr">&lt;<a href="mailto:matthias@rabbitmq.com" target="_blank">matthias@rabbitmq.com</a>&gt;</span> wrote:<br>

</div><div class="gmail_extra"><div class="gmail_quote"><div>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><br>
On 22/07/13 07:25, Alan Antonuk wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
� � - A AMQP_CHANNEL_CLOSE_METHOD means a channel exception has<br>
occurred, you can cast the reply.decoded to amqp_channel_close_t* to get<br>
details on why the channel was closed. �Once a channel has been closed,<br>
it should not be used without reopening the channel with<br>
amqp_channel_open().<br>
</blockquote>
<br></div>
Presumably the app should also send back a channel.close_ok; or is that handled by the library?<div><br></div></blockquote></div><div>Currently the library does not handle this for. �The app should send a channel.close_ok by doing something like</div>


<div><br></div><div>amqp_channel_close_ok_t close_ok;</div><div>int ret = amqp_send_method(conn, channel, AMQP_CHANNEL_CLOSE_OK_METHOD, &amp;close_ok);</div><div>if (AMQP_STATUS_OK != ret) {</div><div>�/* Handle any errors sending the method */</div>

<div>
<div>}</div><div>�</div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
� � - A AMQP_CONNECTION_CLOSE_METHOD means a connection exception has<br>
occurred. You can cast the reply.decoded to amqp_connection_close_t* to<br>
get details on why the broker closed the connection. �Once the<br>
connection has been closed the entire connection should be destroyed and<br>
a new one created before continuing.<br>
</blockquote>
<br></div>
Ditto, but for connection.close_ok.</blockquote><div><br></div></div><div>Same deal as with channels, the app is responsible for sending a connection.close_ok over channel 0.</div><div><br></div><div>Example code for doing this might be:</div>


<div><br></div><div>amqp_connection_close_ok_t close_ok;</div><div>int ret = amqp_send_method(conn, 0, AMQP_CONNECTION_CLOSE_OK_METHOD, &amp;close_ok);</div><div>if (AMQP_STATUS_OK != ret) {</div><div>�/* Handle any errors */</div>


<div>}</div><div>/* This will implicitly close the socket to the broker, and free any buffers held by the connection */</div><div>amqp_destroy_connection(conn);</div><div>�</div></div></div></div>
</blockquote></div><br></div></div></div></div>
</blockquote></div><br></div>