negotiate (Net::SSH::Transport::VersionNegotiator)

    # File lib/net/ssh/transport/version-negotiator.rb, line 46
            def negotiate( socket, version )
              server_version = ""
              @header_lines = []

              loop do
                server_version = socket.readline
                break if server_version.nil? || VERSION_LINE.match( server_version )
                @header_lines << server_version
              end

              if !REQUIRED_VERSION_PATTERN.match( server_version )
                raise Net::SSH::Exception,
                  "incompatible ssh version #{server_version.inspect}"
              end

              if @logger.debug?
                @logger.debug "remote server is #{server_version.chomp.inspect}"
              end
              socket.print "#{version}\r\n"

              return server_version.chomp
            end