/// <summary>
        /// Initializes a new instance of the <see cref="aceRemoteTestServer"/> class.
        /// </summary>
        /// <param name="__settings"></param>
        public aceRemoteTestServer(aceRemoteSettings __settings = null) : base(__settings)
        {
            onServerReceived += new aceRemoteInstanceBaseEvent(received);

            logSettings();

            startSending();

            startListening();
        }
Esempio n. 2
0
        /// <summary>
        /// Initializes a new instance of the <see cref="aceRemoteTestClient"/> class.
        /// </summary>
        /// <param name="__settings"></param>
        public aceRemoteTestClient(aceRemoteSettings __settings) : base(__settings)
        {
            settingsLoadOrDefault();

            logSettings();

            onClientReceived += new aceRemoteInstanceBaseEvent(received);
            onClientSent     += new aceRemoteInstanceBaseEvent(sending);

            List <string> scriptLines = new List <string>();

            string scriptPath = "_testClientScript.txt";

            if (!File.Exists(scriptPath))
            {
                scriptLines.Add("PNG 5;");
                scriptLines.Add("ECH echooo;");
                scriptLines.Add("RND 3;");

                File.WriteAllLines(scriptPath, scriptLines);
            }
            else
            {
                scriptLines.AddRange(File.ReadAllLines(scriptPath));
            }


            if (connect())
            {
                startSending();
                startProcessing();

                foreach (string ln in scriptLines)
                {
                    // Console.ReadLine();
                    string command = commandCheck(ln);
                    log("Command added to: " + sendToStack(command, 50, client).ToString());
                }

                /*
                 * while (true)
                 * {
                 *
                 *  Console.WriteLine("Enter line to send :: ");
                 *  String command = Console.ReadLine();
                 *  command = commandCheck(command);
                 *  log("Command added to: " + sendToStack(command, 50, client).ToString());
                 *
                 * }*/
            }
            else
            {
            }
        }