class Net::SSH::Transport::ServerVersion

  1. lib/net/ssh/transport/server_version.rb
Parent: Transport

Negotiates the SSH protocol version and trades information about server and client. This is never used directly--it is always called by the transport layer as part of the initialization process of the transport layer.

Note that this class also encapsulates the negotiated version, and acts as the authoritative reference for any queries regarding the version in effect.

Methods

Public Class

  1. new

Public Instance

  1. header
  2. version

Included modules

  1. Loggable

Constants

PROTO_VERSION = "SSH-2.0-Ruby/Net::SSH_#{Net::SSH::Version::CURRENT} #{RUBY_PLATFORM}"  

The SSH version string as reported by Net::SSH

Attributes

header [R]

Any header text sent by the server prior to sending the version.

version [R]

The version string reported by the server.

Public Class methods

new (socket, logger)

Instantiates a new ServerVersion and immediately (and synchronously) negotiates the SSH protocol in effect, using the given socket.

[show source]
# File lib/net/ssh/transport/server_version.rb, line 28
def initialize(socket, logger)
  @header = ""
  @version = nil
  @logger = logger
  negotiate!(socket)
end