Class Net::SSH::Connection::Driver
In: lib/net/ssh/connection/driver.rb
Parent: Object

Methods

Included Modules

Constants

Constants

Request = Struct.new( :type, :data, :callback )   A structure for representing global requests, as registered by the global_request method.
DataRequest = Struct.new( :channel, :data, :type )   A structure for representing a data buffer that must be sent across a channel.
MESSAGES = {}  

Public Class methods

Create a new connection driver that communicates over the given transport session. log is the logger instance to write log messages to, buffers is a buffer factory, and channels is a factory that can return new channel instances.

Public Instance methods

Add a callback to be invoked when a channel-open request is recieved for a channel of the given type. The handler-id is returned.

Return the next available channel id for this connection. This method is thread-safe.

Returns an array of active channels.

Send a global request packet to the server. This returns immediately. The given block will be invoked when the server responds.

Repeated call process for as long as the given block returns true. If no block is given, then the loop continues until there are no more open channels on this connection.

Open and return a new channel. This returns immediately, before the server confirms that the channel was opened. When the server sends the confirmation, the on_confirm callback will be invoked.

Sends an innocuous packet to the server to test the connection. Can be used to defeat timeouts on long-running commands.

Wait for and dispatch a single event. If nonblock is false (the default) this will block until a message has been received. Otherwise, it will return immediately.

Delegates to the reader_ready method of the transport session.

Register a data buffer (of an optional type) to be sent across the given channel at the next available opportunity.

This is used internally by channels to hide the window size and maximum packet size from the client. Clients should not call this method directly.

Remove the given channel from the connection.

Remove a callback with the given id for channel-open requests of the given type.

A convenience method for sending messages.

[Validate]