module Net::SSH::Connection
Constants
- GOOD_LOCAL_MAXIUMUM_WINDOW_SIZE
- LOCAL_WINDOW_SIZE_INCREMENT
Public Instance Methods
Invokes the on_close callback when the server closes a channel. The channel is the only argument.
# File lib/net/ssh/connection/channel.rb, line 609 def do_close @on_close.call(self) if @on_close end
Invokes the on_eof callback when the server indicates that no further data is forthcoming. The callback is invoked with the channel as the argument.
# File lib/net/ssh/connection/channel.rb, line 603 def do_eof @on_eof.call(self) if @on_eof end
Invokes the on_extended_data callback when the server sends extended data to the channel. This will reduce the available window size on the local end. The callback is invoked with the channel, type, and data.
# File lib/net/ssh/connection/channel.rb, line 595 def do_extended_data(type, data) update_local_window_size(data.length) @on_extended_data.call(self, type, data) if @on_extended_data end
Invokes the next pending request callback with false
as the second argument.
# File lib/net/ssh/connection/channel.rb, line 615 def do_failure if callback = pending_requests.shift callback.call(self, false) else error { "channel failure received with no pending request to handle it (bug?)" } end end
Invoked when the server failed to open the channel. If an on_open_failed callback was specified, it will be invoked with the channel, reason code, and description as arguments. Otherwise, a ChannelOpenFailed
exception will be raised.
# File lib/net/ssh/connection/channel.rb, line 540 def do_open_failed(reason_code, description) if @on_open_failed @on_open_failed.call(self, reason_code, description) else raise ChannelOpenFailed.new(reason_code, description) end end
Invokes the next pending request callback with true
as the second argument.
# File lib/net/ssh/connection/channel.rb, line 625 def do_success if callback = pending_requests.shift callback.call(self, true) else error { "channel success received with no pending request to handle it (bug?)" } end end