<div dir="ltr">The status codes were introduced in v0.4.0 of the library. Given you&#39;re also using SSL which was also introduced in v0.4.0, I&#39;m guessing you&#39;re using that version of the library. �I would highly encourage you to upgrade to v0.4.1 as there are some potentially serious bugs that are fixed as of that version.<div>

<br></div><div>If you&#39;re using an SSL connection, then yes, if you pull the network cable, it is possible to get an AMQP_STATUS_SSL_ERROR. �As for the AMQP_STATUS_TIMEOUT, a possibility is that the socket times out before the OS informs rabbitmq-c that the socket has been closed because the network is no longer available. If you were to re-try the same call after getting an AMQP_STATUS_TIMEOUT what error-code is returned?</div>
<div><br></div><div>-Alan</div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Wed, Nov 13, 2013 at 9:54 PM, Lothe Shashank <span dir="ltr">&lt;<a href="mailto:Shashank.Lothe@techmahindra.com" target="_blank">Shashank.Lothe@techmahindra.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>
<div style="direction:ltr;font-size:10pt;font-family:Tahoma">Alan,<br>
<br>
For the following query I tried testing the network cable pull out scenario again. However I noticed that the listner API amqp_simple_wait_frame_noblock returns AMQP_STATUS_SSL_ERROR or AMQP_STATUS_TIMEOUT and not the
<font color="993300"><font color="000000">AMQP_STATUS_SOCKET_CLOSED or AMQP_STATUS_SOCKET_ERROR as mentioned by you</font></font>. I am using 0.3.0 of rabbitmq-c library and
<font color="993300"><font color="000000">AMQP_STATUS_SOCKET_CLOSED macro is <font color="000000">
not present in amqp.h.<br>
<br>
<font color="000000">Could you <font color="000000">kindly confirm the return code of
</font></font></font></font></font><font color="993300"><font color="000000"><font color="000000"><font color="000000"><font color="000000">amqp_simple_wait_frame_noblock when network cable is pulled out? How can I handle network cable pull out scenario in
 my listner pro<font color="000000">gram?<br>
<br>
<font color="000000">I have also noti<font color="000000">ced that if two listner threads</font></font> with different amqp connections are running and network cable is pulled
<font color="000000">out one listner<font color="000000"> is receiving </font></font></font></font></font></font></font></font><font color="993300"><font color="000000"><font color="000000"><font color="000000"><font color="000000"><font color="000000"><font color="000000"><font color="000000">AMQP_STATUS_SSL_ERROR
 and another is receiving </font></font></font></font></font></font></font></font><font color="993300"><font color="000000"><font color="000000"><font color="000000"><font color="000000"><font color="000000"><font color="000000"><font color="000000">AMQP_STATUS_TIMEOUT
 as a return value.</font></font><br>
</font></font></font></font></font></font><br>
<u>Older post for your reference:</u><br>
<div>
<p><font color="993300">[Shashank Query]</font> Is there is a way to check from rabbitmq-c library function, if the network cable is pulled out?
<br>
</p>
<p><br>
</p>
</div>
<p><font color="993300">[Alan Reply] <font color="000000">As far as I know, there isn&#39;t a portable socket API for detecting a network cable from being pulled. The best we can do is to detect when the TCP connection has been closed. All rabbitmq-c functions
 that cause a read or write to the socket check the return from these functions to detect the socket being closed unexpectedly. If the socket is closed the client will receive an AMQP_STATUS_SOCKET_CLOSED or AMQP_STATUS_SOCKET_ERROR as a return value.
</font></font></p>
<br>
Thanks and regards,<br>
Shashank<br>
</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>