mil.dod.th.remote.client/src/mil/dod/th/remote/client/impl/Commands.java
@Descriptor("Connect to a controller")
    public void connect(final CommandSession session,
            @Descriptor("Controller host name") final String host,
            @Descriptor("Controller port number") final Integer port) throws UnknownHostException, IOException
    {
        final Socket socket = new Socket(host, port);
        try
        {
            final PrintStream out = session.getConsole();

            m_MessageListenerService.addRemoteChannel(CONTROLLER_ID, socket.getInputStream(),
                new ListenerChannelCallback(out));

            // TD: Update to make the client ID configurable
            m_MessageSenderService.setClientId(1);

            m_MessageSenderService.addRemoteChannel(CONTROLLER_ID, socket.getOutputStream(), null);
        }
        catch (final Exception ex)
        {
            socket.close();
            throw ex;
        }

        m_Socket = socket;
    }
/**
     * Create a socket connection with a controller and add in/out streams to {@link MessageListenerService} and
     * {@link MessageSenderService}.
     * 
     * @param session
     *      Provides access to the Gogo shell session
     * @param host
     *      Host name to connect to
     * @param port
     *      Port number assigned to the controller remote interface
     * @throws UnknownHostException
     *      if IP address of host not found
     * @throws IOException
     *      if error occurs creating socket
     */
Create a socket connection with a controller and add in/out streams to  MessageListenerService and
MessageSenderService.


Create a socket connection with a controller and add in / out streams to MessageListenerService and MessageSenderService .
@Descriptor("Connect to a controller")
    public void connect(final CommandSession session,
            @Descriptor("Controller host name") final String host,
            @Descriptor("Controller port number") final Integer port) throws UnknownHostException, IOException
    {
        final Socket socket = new Socket(host, port);
        try
        {
            final PrintStream out = session.getConsole();
            m_MessageListenerService.addRemoteChannel(CONTROLLER_ID, socket.getInputStream(),
                new ListenerChannelCallback(out));
            m_MessageSenderService.setClientId(1);
            m_MessageSenderService.addRemoteChannel(CONTROLLER_ID, socket.getOutputStream(), null);
        }
        catch (final Exception ex)
        {
            socket.close();
            throw ex;
        }
        m_Socket = socket;
    }
@ Descriptor ( "Connect to a controller" ) public void connect ( final CommandSession session , @ Descriptor ( "Controller host name" ) final String host , @ Descriptor ( "Controller port number" ) final Integer port ) throws UnknownHostException , IOException { final Socket socket = new Socket ( host , port ) ; try { final PrintStream out = session . getConsole ( ) ; m_MessageListenerService . addRemoteChannel ( CONTROLLER_ID , socket . getInputStream ( ) , new ListenerChannelCallback ( out ) ) ; m_MessageSenderService . setClientId ( 1 ) ; m_MessageSenderService . addRemoteChannel ( CONTROLLER_ID , socket . getOutputStream ( ) , null ) ; } catch ( final Exception ex ) { socket . close ( ) ; throw ex ; } m_Socket = socket ; }
Create a socket connection with a controller and add in/out streams to {@link MessageListenerService} and
 {@link MessageSenderService}.
Create a socket connection with a controller and add in / out streams to { @link MessageListenerService } and { @link MessageSenderService } .
// TD: Update to make the client ID configurable