class Net::SSH::Connection::Channel

def send_channel_request(request_name, *data, &callback)

convenient helper methods (see #exec and #subsystem).
Most channel requests you'll want to send are already wrapped in more

end
end
puts "could not start user shell"
else
puts "user shell started successfully"
if success
channel.send_channel_request "shell" do |ch, success|

is dependent on the specific request that was sent.
succeeded or not. The meaning of "success" and "failure" in this context
either true or false as the second, depending on whether the request
callback to be invoked with the channel as the first argument, and
response to this request. Responses, where required, will cause the
reply is required. If no block is given, the server will send no
request, and the packet will be flagged so that the server knows a
If a block is given, it is registered as a callback for a pending
arguments. See Net::SSH::Buffer.from for a description of their format.
parameter must either be empty, or consist of an even number of
Sends a new channel request with the given name. The extra +data+
def send_channel_request(request_name, *data, &callback)
  info { "sending channel request #{request_name.inspect}" }
  fail "Channel open not yet confirmed, please call send_channel_request(or exec) from block of open_channel" unless remote_id
  msg = Buffer.from(:byte, CHANNEL_REQUEST,
                    :long, remote_id, :string, request_name,
                    :bool, !callback.nil?, *data)
  connection.send_message(msg)
  pending_requests << callback if callback
end