title: RabbitMQ C# catch exception problems
body: <p>I have a simple C# application that is sending a message to my RabbitMQ exchange once every second.  When my internet connection drops, the app would crash.  So I added a Try/Catch statement and now it no longer crashes.  But, when the connection is restored, it will not send data anymore.  I have to close the app, and re-open it.  Am I doing this correctly?</p>
  
  <pre><code>   private void rabbitmqxmit()
      {
          try
          {
              while (rmqtxrun == true)
              {
  
                  ConnectionFactory factory = new ConnectionFactory();
                  factory.HostName = textBox3.Text;
                  using (IConnection connection = factory.CreateConnection())
                  using (IModel channel = connection.CreateModel())
                  {
  
  
                      button1.BackColor = Color.Green;
  
                      string message = textBox1.Text;
                      byte[] body = System.Text.Encoding.UTF8.GetBytes(message);
  
                      channel.BasicPublish(textboxExchange.Text, textboxKey.Text, null, body);
  
                      txtboxTransmitting.Text = message;
                      button1.BackColor = Color.Gray;
  
                      Thread.Sleep(Convert.ToInt32(textBox4.Text));
  
                  }
  
  
              }
          }
          catch {}
      }
  </code></pre>