Method: Net::SSH::Connection::Channel#initialize

Defined in:
lib/net/ssh/connection/channel.rb

#initialize(connection, type, local_id, max_pkt_size = 0x8000, max_win_size = 0x20000, &on_confirm_open) ⇒ Channel

Instantiates a new channel on the given connection, of the given type, and with the given id. If a block is given, it will be remembered until the channel is confirmed open by the server, and will be invoked at that time (see #do_open_confirmation).

This also sets the default maximum packet size and maximum window size.



110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
# File 'lib/net/ssh/connection/channel.rb', line 110

def initialize(connection, type, local_id, max_pkt_size = 0x8000, max_win_size = 0x20000, &on_confirm_open)
  self.logger = connection.logger

  @connection = connection
  @type       = type
  @local_id   = local_id

  @local_maximum_packet_size = max_pkt_size
  @local_window_size = @local_maximum_window_size = max_win_size

  @on_confirm_open = on_confirm_open

  @output = Buffer.new

  @properties = {}

  @pending_requests = []
  @on_open_failed = @on_data = @on_extended_data = @on_process = @on_close = @on_eof = nil
  @on_request = {}
  @closing = @eof = @sent_eof = false
end