class Redis::Client

def connect_to(host, port)

def connect_to(host, port)
  with_timeout(@timeout) do
    connection.connect(host, port)
  end
  # If the timeout is set we set the low level socket options in order
  # to make sure a blocking read will return after the specified number
  # of seconds. This hack is from memcached ruby client.
  self.timeout = @timeout
rescue Errno::ECONNREFUSED
  raise Errno::ECONNREFUSED, "Unable to connect to Redis on #{host}:#{port}"
end