[rabbitmq-discuss] Queries regarding rabbitmq-C APIs
Shashank.Lothe at techmahindra.com
Thu Nov 14 05:54:05 GMT 2013
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 AMQP_STATUS_SOCKET_CLOSED or AMQP_STATUS_SOCKET_ERROR as mentioned by you. I am using 0.3.0 of rabbitmq-c library and AMQP_STATUS_SOCKET_CLOSED macro is not present in amqp.h.
Could you kindly confirm the return code of amqp_simple_wait_frame_noblock when network cable is pulled out? How can I handle network cable pull out scenario in my listner program?
I have also noticed that if two listner threads with different amqp connections are running and network cable is pulled out one listner is receiving AMQP_STATUS_SSL_ERROR and another is receiving AMQP_STATUS_TIMEOUT as a return value.
Older post for your reference:
[Shashank Query] Is there is a way to check from rabbitmq-c library function, if the network cable is pulled out?
[Alan Reply] As far as I know, there isn'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.
Thanks and regards,
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.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the rabbitmq-discuss