public Method

Session.open_channel( type="session", data=nil, &block )

Opens a new communication channel over the current connection. This returns immediately. The block will be invoked when then the channel has been opened. (See Net::SSH::Connection::Driver#open_channel).

Source Code

# File net/ssh/session.rb, line 162
def open_channel( type="session", data=nil, &block )
  sanity_check
  channel = @connection.open_channel( type, data )
  channel.on_confirm_open(&block)

  # If we have an agent, and agent-forwarding is enabled, set up
  # the forwarding. Do this once only, after the first channel
  # is opened.
  if @forward_agent && @registry[:userauth].agent
    unless @agent_forwarded
      agentforward.request
      @agent_forwarded = true
    end
  end

  channel
end
Comments

Have your say
Please use Textile formatting (click here for a cheat sheet). Use <code/> and <pre/> for code samples.
Click here to login with OpenID to to post comments.