class Redis::Connection::Ruby

def timeout=(usecs)

def timeout=(usecs)
  secs   = Integer(usecs / 1_000_000)
  usecs  = Integer(usecs - (secs * 1_000_000)) # 0 - 999_999
  optval = [secs, usecs].pack("l_2")
  begin
    @sock.setsockopt Socket::SOL_SOCKET, Socket::SO_RCVTIMEO, optval
    @sock.setsockopt Socket::SOL_SOCKET, Socket::SO_SNDTIMEO, optval
  rescue Errno::ENOPROTOOPT
  end
end