Method: Roby::Application#setup_shell_interface_v2

Defined in:
lib/roby/app.rb

#setup_shell_interface_v2Object

Publishes a shell interface

This method publishes a Roby::Interface object using Interface::V1::TCPServer. It is published on Interface::DEFAULT_PORT by default. This default can be overriden by setting #shell_interface_port either in config/init.rb, or in a Robot.setup block in the robot configuration file.

The shell interface is started in #setup and stopped in #cleanup



2256
2257
2258
2259
2260
2261
2262
2263
2264
2265
2266
2267
2268
2269
2270
2271
2272
2273
2274
2275
2276
# File 'lib/roby/app.rb', line 2256

def setup_shell_interface_v2
    enable_remote_interface_version(2)

    if @shell_interface_v2
        raise "there is already a v2 shell interface started, "\
              "call #stop_shell_interface first"
    end

    @shell_interface_v2 = Interface::V2::TCPServer.new(
        self,
        host: shell_interface_v2_host, port: shell_interface_v2_port,
        server_fd: shell_interface_v2_fd
    )
    shell_interface_v2.abort_on_exception = shell_abort_on_exception?
    if shell_interface_v2_fd
        Robot.info "shell interface v2 started on file descriptor "\
                   "#{shell_interface_v2_fd}"
    else
        Robot.info "shell interface v2 started on port #{shell_interface_v2_port}"
    end
end