def choose_listen_method
      if @options[:long_polling_only]
        update_listen_state(:long_poll)
        @connect_interval = MAX_CONNECT_INTERVAL
      elsif @websocket
        update_listen_state(:choose, @connect_interval)
      else
        if @attempted_connect_at.nil?
          interval = 0
        elsif (interval = @connect_interval - (Time.now - @attempted_connect_at)) < 0 ||
              [NORMAL_CLOSE, SHUTDOWN_CLOSE].include?(@close_code) ||
              router_not_responding?
          interval = 0
        end
        update_listen_state(:connect, interval)
      end
      true
    end
def choose_listen_method
      if @options[:long_polling_only]
        update_listen_state(:long_poll)
        @connect_interval = MAX_CONNECT_INTERVAL
      elsif @websocket
        update_listen_state(:choose, @connect_interval)
      else
        if @attempted_connect_at.nil?
          interval = 0
        elsif (interval = @connect_interval - (Time.now - @attempted_connect_at)) < 0 ||
              [NORMAL_CLOSE, SHUTDOWN_CLOSE].include?(@close_code) ||
              router_not_responding?
          interval = 0
        end
        update_listen_state(:connect, interval)
      end
      true
    end
Determine whether should retry creation of WebSocket connection now
 Should only retry if (1) WebSocket is enabled, (2) there is none currently,
 (3) previous closure was for acceptable reasons (normal, router shutdown,
 router inaccessible), or (4) enough time has elapsed to make another attempt

 @return [TrueClass] always true