Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[dsdp-tm-dev] Telnet Help

Hi,

I have connected to a host, i get the shell service, now when i try to launch the shell, the application is hanging at TelnetConnectorService -- client.connect(host, getTelnetPort()) of makeNewTelnetClient() method. Could you tell me what i am missing here...

        IHost host = null;
        try {
            boolean isRegistryActive = RSEUIPlugin.isTheSystemRegistryActive();
            if (isRegistryActive) {
                Job[] jobs = Job.getJobManager ().find(null);
                for (int i = 0; i < jobs.length; i++) {
                    if ("Initialize RSE".equals(jobs[i].getName())) { //$NON-NLS-1$
                        // If still initializing, wait until done
                        jobs[i].join();
                        break;
                    }
                }

                IHost[] connections = RSECorePlugin.getTheSystemRegistry()
                        .getHostsBySubSystemConfigurationCategory("shells");
               
                IRSESystemType sysType = null;
                for (int i = 0; i < connections.length; i++) {
                    if (connections[i].getName().equals(connectionName)) {
                        sysType = connections[i].getSystemType();
                        break;
                    }
                }
                ISystemRegistry sr = RSECorePlugin.getTheSystemRegistry();
                host = sr.createHost(sysType, connectionName, connectionName,
                        "Remote connection");
            }

            ISubSystem[] subSystems = host.getSubSystems ();
            int i;
            for (i = 0; subSystems != null && i < subSystems.length; i++) {
                if (subSystems[i] instanceof IShellServiceSubSystem)
                    break;
            }

            final ISubSystem subSystem = subSystems[i];
            subSystem.getConnectorService().setUserId("temp");
            subSystem.getConnectorService().setPassword("temp", "temp", true,
                    true);
            subSystem.getConnectorService().saveUserId();
            subSystem.getConnectorService().savePassword();

            Display.getDefault().syncExec(new Runnable() {
                public void run() {
                    try {
                        subSystem.connect(true, null);
                    } catch (Exception e) {
                    }
                }
            });

            IHostShell hostShell = null;
            IShellService shellService = ((IShellServiceSubSystem) subSystem)
                    .getShellService();
            String env[] = new String[0];
            if (shellService != null) {
                try {
                    Thread.sleep(1000);
                } catch (InterruptedException e) {
                    e.printStackTrace();
                }
                hostShell = shellService.launchShell("", env,
                        new NullProgressMonitor());
            }

Regards
Hari

Back to the top