コード例 #1
0
 public void disconnectClient()
 {
     if (isClientConnected())
     {
         client.disconnect();
     }
 }
コード例 #2
0
        /// <summary>
        /// this function disconnect the socket.
        /// </summary>
        private void disconnectSockets()
        {
            Connector     connector = Connector.getInstance();
            ITelnetClient tc        = connector.getClient();
            TelnetServer  ts        = connector.getServer();

            if (tc != null)
            {
                tc.disconnect();
            }
            if (ts != null)
            {
                ts.closeServer();
            }
        }
コード例 #3
0
        /// <summary>
        /// this function execute the connectCommand.
        /// </summary>
        public void executeConnectCommand()
        {
            Connector connector = Connector.getInstance();

            /* if connection established at first */
            if (connectPerformed == 0)
            {
                connectPerformed = 1;
                // update the ip
                Ip         = (string)Settings.Default["IP"];
                ServerPort = Int32.Parse((string)Settings.Default["PortServer"]);
                int check = ts.startServer(ip, serverPort);
                if (check == 0)
                {
                    // update the port
                    ClientPort = Int32.Parse((string)Settings.Default["PortClient"]);
                    mtc.connect(ip, clientPort);
                    connector.setServer(ts);
                    connector.setClient(mtc);
                    IJoystickModel model = connector.getJoystickModel();
                    model.setTelnetClient(mtc);
                    ts.readData();
                }
            }
            /* if connection has been established once */
            else
            {
                ts.closeServer();
                Ip         = (string)Settings.Default["IP"];
                ServerPort = Int32.Parse((string)Settings.Default["PortServer"]);
                int check = ts.startServer(ip, serverPort);
                if (check == 0)
                {
                    mtc.disconnect();
                    // update the port
                    ClientPort = Int32.Parse((string)Settings.Default["PortClient"]);
                    mtc.connect(ip, clientPort);
                    connector.setServer(ts);
                    connector.setClient(mtc);
                    IJoystickModel model = connector.getJoystickModel();
                    model.setTelnetClient(mtc);
                    ts.readData();
                }
            }
        }
コード例 #4
0
 public void disconnect()
 {
     stop = true;
     Err_visiblity_Not_Connected = Visibility.Visible;
     telnetClient.disconnect();
 }
コード例 #5
0
 //this function disconnect the model to the server.
 public void disconnect()
 {
     stop = true;
     telnetClient.disconnect();
     ErrorMessage = "Plesde restart your server again and\n press connect to start the simulator.";
 }
コード例 #6
0
 public static void disconnect()
 {
     telnetClient.disconnect();
 }
コード例 #7
0
 public void disconnect()
 {
     stop = true;
     telnetClient.disconnect();
 }
コード例 #8
0
 public void disconnect()
 {
     // Disconnect from server.
     stop = true;
     telnetClient.disconnect();
 }
コード例 #9
0
 public void disconnect()
 {
     m_stop = true;
     m_telnetClient.disconnect();
 }
コード例 #10
0
 public void stop()
 {
     isStopped = true;
     telnetClient.write(detectionFlight[detectionFlight.Count - 1].ToString());
     telnetClient.disconnect();
 }