56: def initialize(host, options={})
57: self.logger = options[:logger]
58:
59: @host = host
60: @port = options[:port] || DEFAULT_PORT
61: @options = options
62:
63: debug { "establishing connection to #{@host}:#{@port}" }
64: factory = options[:proxy] || TCPSocket
65: @socket = timeout(options[:timeout] || 0) { factory.open(@host, @port) }
66: @socket.extend(PacketStream)
67: @socket.logger = @logger
68:
69: debug { "connection established" }
70:
71: @queue = []
72:
73: @host_key_verifier = select_host_key_verifier(options[:paranoid])
74:
75: @server_version = ServerVersion.new(socket, logger)
76:
77: @algorithms = Algorithms.new(self, options)
78: wait { algorithms.initialized? }
79: end