/// <summary> /// Opens a connection to the server. Required to send commands. /// </summary> private void ConnectToServer() { ClientConnector.Connect(Console.WriteLine, Port); // start the connection with server to get output Thread outputThread = new Thread(ClientConnector.OutputThread) { Name = "ChildIO Output Console" }; outputThread.Start(new ThreadPayLoad(Console.WriteLine, Port)); }
private static void ClientInstance(int portNumber) { ClientConnector.Connect(Console.WriteLine, portNumber); // start the connection with server to get output Thread outputThread = new Thread(new ParameterizedThreadStart(ClientConnector.OutputThread)) { Name = "ChildIO Output Console" }; outputThread.Start(new ThreadPayLoad(Console.WriteLine, portNumber)); while (true) { var command = Console.ReadLine(); ClientConnector.SendCommand(command, Console.WriteLine); } }
/// <summary> /// Sends the specified command to the server /// </summary> /// <param name="command"></param> private static void SendCommand(string command) { ClientConnector.SendCommand(command, Console.WriteLine); }