    # File lib/rbot/ircbot.rb, line 1262
      def ping_server
        act_timeout = @config['server.ping_timeout']
        return if act_timeout <= 0
        now = Time.now
        if @last_rec && now > @last_rec + act_timeout
          if @last_ping.nil?
            # No previous PING pending, send a new one
            sendq "PING :rbot"
            @last_ping = Time.now
          else
            diff = now - @last_ping
            if diff > act_timeout
              debug "no PONG from server in #{diff} seconds, reconnecting"
              # the actual reconnect is handled in the main loop:
              raise TimeoutError, "no PONG from server in #{diff} seconds"
            end
          end
        end
      end