class Redis::Client

def call_command(argv)

try to reconnect just one time, otherwise let the error araise.
Wrap raw_call_command to handle reconnection on socket error. We
def call_command(argv)
  log(argv.inspect, :debug)
  connect_to_server unless connected?
  begin
    raw_call_command(argv.dup)
  rescue Errno::ECONNRESET, Errno::EPIPE, Errno::ECONNABORTED
    if reconnect
      raw_call_command(argv.dup)
    else
      raise Errno::ECONNRESET
    end
  end
end