コード例 #1
0
        public void completeConnection(DXChild c)
        {
            if (c != null)
            {
                switch (c.waitForConnection())
                {
                    case -1:
                        ErrorDialog ed = new ErrorDialog();
                        ed.post("Connection to server {0} failed: {1}",
                            c.getServer(), c.failed());
                        closeConnection(c);
                        break;
                    case 0:
                        if (resource.executeProgram)
                            getExecCtl().executeOnce();
                        break;
                    case 1:
                        InfoDialog id = new InfoDialog();
                        id.post("Connection to server {0} has been queued", c.getServer());
                        break;
                }
            }
            else if (!serverInfo.autoStart)
            {
                connectToServer(serverInfo.port, null);
            }

            // Let the application packet know that a new connection to
            // the server has been created.
            if (applicationPacket != null)
                applicationPacket.handleServerConnection();

            if (resource.executeOnChange)
                getExecCtl().enableExecOnChange();
        }