Class Net::SSH::Connection::Channel
In: lib/net/ssh/connection/channel.rb
Parent: Object

Methods

Included Modules

Constants

Constants

VALID_PTY_OPTIONS = { :term=>"xterm", :chars_wide=>80, :chars_high=>24, :pixels_wide=>640, :pixels_high=>480, :modes=>{}, :want_reply=>false }

Attributes

connection  [R]  The connection driver instance that owns this channel
local_id  [R]  The channel’s local id (assigned by the connection)
local_maximum_packet_size  [R]  The maximum packet size that may be sent over this channel
local_window_size  [R]  The maximum data window size for this channel
maximum_packet_size  [R]  The maximum packet size that may be sent over this channel
remote_id  [R]  The channel’s remote id (assigned by the remote server)
type  [R]  The type of this channel
window_size  [R]  The maximum data window size for this channel

Public Class methods

Creates a new channel object with the given internal information. The channel is assumed to already be connected to a remote host.

A convenience method for defining new event callbacks.

Create a new channel object on the given connection, and of the given type.

Requests that a new channel be opened on the remote host. This will return immediately, but the on_confirm_open callback will be invoked when the remote host confirms that the channel has been successfully opened.

Public Instance methods

[]( name )

Alias for property

[]=( name, value )

Alias for set_property

Invoked when the server failed to confirm the opening of a channel.

Invoked when the server confirms the opening of a channel.

Invoked when the server sends a data packet. This in turn calls the "on_data" callback.

Invoked when the server sends an extended data packet. This in turn calls the "on_extended_data" callback.

Invoked when the server asks to adjust the window size. This in turn calls the "on_window_adjust" callback.

Execute the given remote command over the channel. This should be invoked in the "on_confirm" callback of a channel. This method will return immediately.

Set the callback to be invoked when the channel is closed.

Set the callback to use when the channel could not be opened for some reason.

Set the callback to use when the channel has been confirmed to be open.

Set the callback to be invoked when the server sends a data packet over the channel.

Set the callback to be invoked when the server sends an EOF packet.

Set the callback to be invoked when the server sends an extended data packet over the channel.

Set the callback to invoked when the server sends notification of a failed operation.

Set the callback to be invoked when the server sends a request packet.

Set the callback to invoked when the server sends confirmation of a successful operation.

Set the callback to be invoked when the server requests that the window size be adjusted.

Retrieved a named property of the channel.

Request that a pty be opened for this channel. Valid options are :term, :chars_wide, :chars_high, :pixels_wide, :pixels_high, :modes, and :want_reply. :modes is a Hash, where the keys are constants from Net::SSH::Service::Term, and values are integers describing the corresponding key.

Send a data packet to the server, over the channel.

Send a data packet to the server, over the channel. Only sends as much of that data as the channel is currently capable of sending (based on window size and maximum packet size), and returns any data that could not be sent. Returns nil if all the data that was requested to be sent, was sent.

Send an EOF across the channel. No data should be sent from the client to the server over this channel after this, although packets may still be received from the server.

Send an extended data packet to the server, over the channel. Extended data always has a numeric type associated with it. The only predefined type is 1, whic corresponds to stderr data.

Send an extended data packet to the server, over the channel. Extended data always has a numeric type associated with it. The only predefined type is 1, whic corresponds to stderr data.

Send a generic channel request with the given name. The data item will be written directly into the request (after converting it to a string, as necessary).

Send a channel request with the given name. It will have one data item, which will be interpreted as a string.

Send the given signal to process on the other side of the channel. The parameter should be one of the Channel::SIGxxx constants.

Send a "window adjust" message to the server for this channel, informing it that it may send this many more bytes over the channel.

Set a named property on the channel.

Request the given subsystem. This method will return immediately.

[Validate]