# File lib/rbot/ircbot.rb, line 860
  def start_server_pings
    stop_server_pings
    return unless @config['server.ping_timeout'] > 0
    # we want to respond to a hung server within 30 secs or so
    @ping_timer = @timer.add(30) {
      @last_ping = Time.now
      @socket.queue "PING :rbot"
    }
    @pong_timer = @timer.add(10) {
      unless @last_ping.nil?
        diff = Time.now - @last_ping
        unless diff < @config['server.ping_timeout']
          debug "no PONG from server for #{diff} seconds, reconnecting"
          begin
            @socket.shutdown
          rescue
            debug "couldn't shutdown connection (already shutdown?)"
          end
          @last_ping = nil
          raise TimeoutError, "no PONG from server in #{diff} seconds"
        end
      end
    }
  end