def handle_tcp_failure(connection, settings)

      logger.info("Connection to AMQP lost. Finding new host..")

      if @amqp_hosts.size == 1
        logger.info("Only a single host.. reconnecting")
        connection.reconnect(false, 10)
        return
      end

      current_host = settings[:host]
      new_host = get_new_amqp_host(@amqp_hosts)

      while new_host == current_host
        new_host = get_new_amqp_host(@amqp_hosts)
      end

      settings[:host] = new_host

      logger.info ("Reconnecting to AMPQ host: #{new_host}")

      connection.reconnect_to(settings)
    end
def handle_tcp_failure(connection, settings)

      logger.info("Connection to AMQP lost. Finding new host..")

      if @amqp_hosts.size == 1
        logger.info("Only a single host.. reconnecting")
        connection.reconnect(false, 10)
        return
      end

      current_host = settings[:host]
      new_host = get_new_amqp_host(@amqp_hosts)

      while new_host == current_host
        new_host = get_new_amqp_host(@amqp_hosts)
      end

      settings[:host] = new_host

      logger.info ("Reconnecting to AMPQ host: #{new_host}")

      connection.reconnect_to(settings)
    end
Public: Callback to handle TCP connection loss

 connection - An AMQP Connection
 settings - Current AMQP settings (see amq-client/lib/amq/client/settings.rb and lib/amq/client/async/adapter.rb)

 Returns nothing.