Method: Net::SSH::Connection::Channel#on_extended_data

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

#on_extended_data(&block) ⇒ Object

Registers a callback to be invoked when extended data packets are received by the channel. The callback is called with the channel as the first argument, the data type (as an integer) as the second, and the data as the third. Extended data is almost exclusively used to send stderr data (type == 1). Other extended data types are not defined by the SSH protocol.

channel.on_extended_data do |ch, type, data|
  puts "got stderr: #{data.inspect}"
end


345
346
347
348
# File 'lib/net/ssh/connection/channel.rb', line 345

def on_extended_data(&block)
  old, @on_extended_data = @on_extended_data, block
  old
end