Exemplo n.º 1
0
        /// <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));
        }
Exemplo n.º 2
0
        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);
            }
        }
Exemplo n.º 3
0
 /// <summary>
 /// Sends the specified command to the server
 /// </summary>
 /// <param name="command"></param>
 private static void SendCommand(string command)
 {
     ClientConnector.SendCommand(command, Console.WriteLine);
 }