public void disconnectClient() { if (isClientConnected()) { client.disconnect(); } }
/// <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(); } }
/// <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(); } } }
public void disconnect() { stop = true; Err_visiblity_Not_Connected = Visibility.Visible; telnetClient.disconnect(); }
//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."; }
public static void disconnect() { telnetClient.disconnect(); }
public void disconnect() { stop = true; telnetClient.disconnect(); }
public void disconnect() { // Disconnect from server. stop = true; telnetClient.disconnect(); }
public void disconnect() { m_stop = true; m_telnetClient.disconnect(); }
public void stop() { isStopped = true; telnetClient.write(detectionFlight[detectionFlight.Count - 1].ToString()); telnetClient.disconnect(); }