Hi,<br><br>I am using the rabbitmq-c C libraries to publish messages to a Rabbitmq exchange.<br><br>Problem I have is that when rabbitmq server stops for some reason (rabbtmqctl stop_app / start_app for instance), the socket between my publisher program and rabbitmq is destroyed but I don&#39;t manage to catch any error code properly so that the program can try to establish a new connection.<br>
<br>When I stop rabbitmq, my publisher program exits with the message: &quot;Broken Pipe&quot; when it tries to send a message.<br><br>Is there a way to check the socket before sending a message so that I can try to re-establish a connection ?<br>
<br>The way I publish is :<br><br>rc = amqp_basic_publish(amqp_connection, 1,� amqp_cstring_bytes(&quot;Exchange&quot;), amqp_cstring_bytes(routingkey), 0, 0, NULL, body);<br><br>if (rc &lt; 0)� {<br>��� printf(&quot;error during publish : %s\n&quot;, strerror(-rc)) ;<br>
�}<br><br>problem is that if rabbitmq is stopped,� the line &quot;rc = amqp_basic_publish ...make the program exit, I cannot get the rc value).<br><br>Thanks,<br>Regards,<br><br>Fab<br><br><br><br>