<div dir="ltr">You appear to be doing things correctly.<div><br></div><div>Could you try running your program under valgrind to see if it reports anything?</div><div><br></div><div>-Alan</div></div><div class="gmail_extra">
<br><br><div class="gmail_quote">On Tue, Feb 11, 2014 at 10:02 PM, Rohit Patle <span dir="ltr"><<a href="mailto:Rohit.Patle@techmahindra.com" target="_blank">Rohit.Patle@techmahindra.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">





<div>
<div style="direction:ltr;font-size:10pt;font-family:Tahoma">Hi Alan,<br>
<br>
Thank you for your reply. Sure I will take care of <font><span style="font-size:10pt">addressing my mail to
</span></font><font><span style="font-size:10pt">rabbitmq-discuss only. <br>
<br>
Here is our observation.<br>
1. Network cable is pulled off from my system.<br>
2. The listener program is in a while loop trying to reconnect to RMQ broker.<br>
3. Following are the set of APIs called in this while loop.<br>
<br>
<font color="800000">while(1)<br>
{<br>
�� conn = amqp_new_connection();<br>
<br>
� socket = amqp_ssl_socket_new(conn);<br>
� if (!socket) {<br>
��� </font></span></font><font><span style="font-size:10pt"><font color="800000"><font><span style="font-size:10pt"><font color="800000">printf</font></span></font>("creating SSL/TLS socket");<br>
��� exit (0);<br>
� }<br>
<br>
� if (argc > 5) {<br>
��� status = amqp_ssl_socket_set_cacert(socket, argv[5]);<br>
��� if (status) {<br>
����� </font></span></font><font><span style="font-size:10pt"><font color="800000"><font><span style="font-size:10pt"><font color="800000">printf</font></span></font>("setting CA certificate");<br>
</font></span></font>����� <font><span style="font-size:10pt"><font color="800000"><font><span style="font-size:10pt"><font color="800000">exit (0);<br>
</font></span></font>��� }<br>
� }<br>
<br>
� if (argc > 7) {<br>
��� status = amqp_ssl_socket_set_key(socket, argv[7], argv[6]);<br>
��� if (status) {<br>
����� printf("setting client cert");<br>
����� </font></span></font><font><span style="font-size:10pt"><font color="800000"><font><span style="font-size:10pt"><font color="800000">exit (0);<br>
</font></span></font>��� }<br>
� }<br>
� amqp_ssl_socket_set_verify(socket, 0); <br>
� status = amqp_socket_open(socket, hostname, port);<br>
� if (status) {<br>
��� </font></span></font><font><span style="font-size:10pt"><font color="800000"><font><span style="font-size:10pt"><font color="800000">printf</font></span></font>("opening SSL/TLS connection");</font></span></font><br>

<font><span style="font-size:10pt"><font color="800000"><font><span style="font-size:10pt">��� amqp_destroy_connection(conn);</span></font>
<br>
�}<br>
else<br>
��� break;<br>
}</font><br>
<font color="000000"><br>
4. As network cable is removed from my system before running this test program, I getting "</font></span></font><font color="000000"><span style="font-size:10pt"><font><span style="font-size:10pt">opening SSL/TLS connection"</span></font>
 which is a valid error (status value -9). However </span></font><font color="000000"><span style="font-size:10pt"><font><span style="font-size:10pt"><font><span style="font-size:10pt">amqp_destroy_connection() API is not releasing
 the <font color="000000">resources</font></span></font></span></font> allocated during
</span></font><font color="000000"><span style="font-size:10pt"><font><span style="font-size:10pt">amqp_new_connection() API call. Could you please confirm the behaviour of
</span></font></span></font><font><span style="font-size:10pt"><font><span style="font-size:10pt"><font color="800000"><font><span style="font-size:10pt"><font color="000000"><span style="font-size:10pt"><font><span style="font-size:10pt"><font color="000000"><font color="000000">amqp_destroy_connection(<font color="000000">)
 API when there is no network cable attached to the system?<font color="000000"> There is memory leak happening due to this API.</font></font></font><br>
</font></span></font></span></font></span></font></font></span></font></span></font><br>
How to destroy <font><span style="font-size:10pt"><font><span style="font-size:10pt">the amqp_connection_state_t object created during
</span></font></span></font><font><span style="font-size:10pt"><font><span style="font-size:10pt"><font color="000000"><span style="font-size:10pt"><font><span style="font-size:10pt">amqp_new_connection()?</span></font></span></font></span></font><br>

<br>
Please suggest. <br>
<br>
Thanks & Regards,<br>
Rohit<br>
</span></font></div>
<br>
<hr>
<font face="Arial" color="Navy"><br>
DISCLAIMER:<br>
This email (including any attachments) is intended for the sole use of the intended recipient/s and may contain material that is CONFIDENTIAL AND PRIVATE COMPANY INFORMATION. Any review or reliance by others or copying or distribution or forwarding of any or
 all of the contents in this message is STRICTLY PROHIBITED. If you are not the intended recipient, please contact the sender by email and delete all copies; your cooperation in this regard is appreciated.<br>
</font>
</div>

<br>_______________________________________________<br>
rabbitmq-discuss mailing list<br>
<a href="mailto:rabbitmq-discuss@lists.rabbitmq.com">rabbitmq-discuss@lists.rabbitmq.com</a><br>
<a href="https://lists.rabbitmq.com/cgi-bin/mailman/listinfo/rabbitmq-discuss" target="_blank">https://lists.rabbitmq.com/cgi-bin/mailman/listinfo/rabbitmq-discuss</a><br>
<br></blockquote></div><br></div>