Beispiel #1
0
        static void Main(string[] args)
        {
            ParseArgs(args);

            if (useTestObjs)
            {
                CliServLib.DefaultImpl.TaskClient tCli = new CliServLib.DefaultImpl.TaskClient(_ip, _port, "TestClient");
                tCli.InternMsgClient.ResetEvent += InternMsgClient_ResetEvent;
                var res = RunmeTest(tCli);
                Console.WriteLine("Client Return: {0}", res.Success);
                if (res.Failure)
                {
                    Console.WriteLine(res.Error);
                }
            }
            else
            {
                TaskClientExample ex = new TaskClientExample(_ip, _port);
                //MessageClient ex = new MessageClient("127.0.0.1", CliServDefaults.DfltPort, "TestClient");
                ex.ResetEvent += Ex_ResetEvent;
                var res = Runme(ex);
                Console.WriteLine("Client Return: {0}", res.Success);
                if (res.Failure)
                {
                    Console.WriteLine(res.Error);
                }
            }
            Console.WriteLine("Hit ENTER to Exit...");
            Console.ReadLine();
        }
Beispiel #2
0
 //       static TcpLib.Result Runme(TaskClientExample ex)
 static TcpLib.Result Runme(TaskClientExample ex)
 {
     ex.Start();
     while (!_done)
     {
         System.Threading.Thread.Sleep(1000);
         if (!_reset)
         {
             if (ex.RunResult != null)
             {
                 _done = true;
             }
         }
     }
     return(ex.RunResult);
 }