Couple notes:<div><br></div><div>- Doing a connection_close() implicitly closes all channels. You don&#39;t need to explicitly close channels.</div><div>- If you get a connection timeout error while using the connection object, the whole connection is dead. You won&#39;t be able to do a channel_close or connection_close. The only thing you can do is destroy the connection object (which should clean up any memory and close any partially open sockets).</div>
<div><br></div><div>I&#39;m not sure how you set up your exchanges/queues on the broker, but I don&#39;t think it should matter what connection you publish your message over.</div><div><br></div><div>-Alan<br><br><div class="gmail_quote">
On Sat, Nov 24, 2012 at 4:35 PM, Borman Squirrel <span dir="ltr">&lt;<a href="mailto:triton.genocide@gmail.com" target="_blank">triton.genocide@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>Hi everybody, carrot eaters! :)</div><div><br></div>I am using rabbitmq-c driver.<div><br><div>Sometimes when I try to publish a message (using basic publish method) from a thread that is acting like worker for sending messages, I am geting an error due to connection time out.�</div>
<div><br></div><div>When I try to close channel and connection to restablishing connection, I get broken pipe exception and consecuently I can not close the connection. After that, the worker enters in a new loop iteration and create a new socket, a new channel, a new connection ... It seems that the server, due to exists two connections, does not send the messages to clients through the right connection and the messages never reaches the clients.</div>
<div><br></div><div>This is the pseudocode :</div><div><br></div><div>worker_sender()</div><div>{</div><div>� � while(1)</div><div>� � {</div><div>� � � � �opening_socket<br></div><div>� � � � �logging_in</div><div>� � � � �opening_channel</div>
<div><br></div><div>� � � � �while(1)</div><div>� � � � �{</div><div>� � � � � � � if(error(basic_publish()) //here connection timeout error</div><div>� � � � � � � � � break;</div><div>� � � � �}</div><div><br></div><div>
<div>� � � � �closing_channel //here broken pipe exception<br></div><div>� � � � �closing_connection //here broken pipe exception</div><div>� � � � �destroy_connection</div></div><div>� � }</div><div>� ��</div><div>� � return</div>
<div>}</div><div><br></div><div>It would be possible to solve this issue with other approach or some adjustment to the showed solution?</div><div><br></div><div>Thanks in advance!</div><div><br></div></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>