--- !ruby/object:RI::MethodDescription 
aliases: []

block_params: 
comment: 
- !ruby/struct:SM::Flow::P 
  body: Registers a callback to be invoked when a channel request of the given type is received. The callback will receive the channel as the first argument, and the associated (unparsed) data as the second. The data will be a Net::SSH::Buffer that you will need to parse, yourself, according to the kind of request you are watching.
- !ruby/struct:SM::Flow::P 
  body: By default, if the request wants a reply, Net::SSH will send a CHANNEL_SUCCESS response for any request that was handled by a registered callback, and CHANNEL_FAILURE for any that wasn't, but if you want your registered callback to result in a CHANNEL_FAILURE response, just raise Net::SSH::ChannelRequestFailed.
- !ruby/struct:SM::Flow::P 
  body: "Some common channel requests that your programs might want to listen for are:"
- !ruby/object:SM::Flow::LIST 
  contents: 
  - !ruby/struct:SM::Flow::LI 
    label: "*"
    body: "&quot;exit-status&quot; : the exit status of the remote process will be reported as a long integer in the data buffer, which you can grab via data.read_long."
  - !ruby/struct:SM::Flow::LI 
    label: "*"
    body: "&quot;exit-signal&quot; : if the remote process died as a result of a signal being sent to it, the signal will be reported as a string in the data, via data.read_string. (Not all SSH servers support this channel request type.)"
  - !ruby/struct:SM::Flow::P 
    body: channel.on_request &quot;exit-status&quot; do |ch, data|
  - !ruby/struct:SM::Flow::VERB 
    body: "  puts &quot;process terminated with exit status: #{data.read_long}&quot;\n"
  - !ruby/struct:SM::Flow::P 
    body: end
  type: :BULLET
full_name: Net::SSH::Connection::Channel#on_request
is_singleton: false
name: on_request
params: (type, &block)
visibility: public
