public async void Connect(string ip, int port) { await Task.Run(() => telnetClient.Connect(ip, port)); stop = false; Status = "Connected"; StartReading(); }
// Connect the model to the simulator. public void Connect(string ip, string port) { stop = false; ConnectionStatus = telnetClient.Connect(ip, port); if (ConnectionStatus != "Status: Cannot connect (invalid ip or port)") { Start(); SetJoystickSliders(); } }
//A function to connect as a client to the simulator. public void ConnectCommandsClient(string FlightServerIP, int FlightCommandPort) { //disconnect from former connections. DisconnectCommandsClient(); //connect if disconnected successfully if (!connectionClient) { tc.Connect(FlightServerIP, FlightCommandPort); connectionClient = true; } }
public void addClient(Tuple <String, int> key) { mutex.WaitOne(); try { ITelnetClient client = clientsFactory.New(); client.Connect(key.Item1, key.Item2); clients[key] = new ManagableClient(client, Timeout); } finally { mutex.ReleaseMutex(); } }
// Connect to server. public void Connect() { ConnectionErrorMessage = string.Empty; try { client.Connect(this.ip, Int32.Parse(this.port)); ErrorScreen = "Welcome to Flight Simulator!"; } catch (Exception) { ConnectionErrorMessage = "Unable to connect, please try again"; throw new Exception("Unable to connect, please try again"); } }
//Connection to server. public void Connect(string ip, int port) { client = new MyTelnetClient(); try { client.Connect(ip, port); MessageInd = true; Message = "Connected to server."; Connected = true; } catch (Exception) { MessageInd = true; Connected = false; Message = "Unable to connect to server."; } }
public void Connect() { try { // Try connect. telnetClient.Connect(); Connecting = "connected"; Initialize(); this.start(); } catch (Exception e) { // We couldn't connect. if (e.Message == "not connected") { this.ConnectError = true; } } }
public void Connect(string ip, int port) { myTelnetClient.Connect(ip, port); }
//function responsible to send IP,port to the model in order to connect to the server public void ConnectToSimulator() { model.Connect(IP, Port); }