static void Main(string[] args)
        {
            var cmd = CommandLineParameters.Parse(args);

            if (cmd == null || cmd.Benchmark != BenchmarkType.None)
            {
                BenchmarkRunner.Run <Stress>();

                return;
            }

            Console.WriteLine($"Command Line: {cmd}");

            if (cmd.IsServer)
            {
                StartServer();

                StartClients(cmd);
            }

            if (cmd.IsClient)
            {
                BeginClient(cmd);
            }

            var waits = ProcessWaits.Select(p => new ProcessWaitHandle(p)).ToArray();

            WaitHandle.WaitAll(waits);

            Teardown();
        }
Exemple #2
0
        static async Task Main(string[] args)
        {
            var cmd = CommandLineParameters.Parse(args);

            if (cmd == null)
            {
                BenchmarkRunner.Run(typeof(Program).Assembly);
                return;
            }

            if (cmd.Benchmark == BenchmarkType.Timing)
            {
                BenchmarkRunner.Run <MessageBenchmarks>();
                return;
            }

            if (cmd.Benchmark == BenchmarkType.Stress)
            {
                BenchmarkRunner.Run <StressAsReq>();
                BenchmarkRunner.Run <StressTgsReq>();
                return;
            }

            if (cmd.Benchmark == BenchmarkType.DH)
            {
                BenchmarkRunner.Run <BCryptDiffieHellmanBenchmarks>();
                return;
            }

            Console.WriteLine($"Command Line: {cmd}");

            if (cmd.IsServer)
            {
                await StartServer();

                StartClients(cmd);
            }

            if (cmd.IsClient)
            {
                BeginClient(cmd);
            }

            var waits = ProcessWaits.Select(p => new ProcessWaitHandle(p)).ToArray();

            WaitHandle.WaitAll(waits);

            Teardown();
        }
Exemple #3
0
        static async Task Main(string[] args)
        {
            var cmd = CommandLineParameters.Parse(args);

            if (cmd == null)
            {
                BenchmarkRunner.Run(typeof(Program).Assembly);
                return;
            }

            if (cmd.Benchmark == BenchmarkType.Timing)
            {
                BenchmarkRunner.Run <MessageBenchmarks>();
                return;
            }

            if (cmd.Benchmark == BenchmarkType.Stress)
            {
                BenchmarkRunner.Run <StressAsReq>();
                BenchmarkRunner.Run <StressTgsReq>();
                return;
            }

            if (cmd.Benchmark == BenchmarkType.DH)
            {
                BenchmarkRunner.Run <BCryptDiffieHellmanBenchmarks>();
                return;
            }

            if (cmd.Benchmark == BenchmarkType.Pac)
            {
                BenchmarkRunner.Run <PacEncodingBenchmarks>();
                return;
            }

            Console.WriteLine($"Command Line: {cmd}");

            if (cmd.IsServer)
            {
                await StartServer();

                StartClients(cmd);

                Console.WriteLine("All clients started");
            }

            if (cmd.IsClient)
            {
                BeginClient(cmd);
            }

            var list = SplitList(ProcessWaits.Select(p => new ProcessWaitHandle(p)).ToList(), 64);

            foreach (var waits in list)
            {
                if (waits.Count > 0)
                {
                    WaitHandle.WaitAll(waits.ToArray());
                }
            }

            Teardown();

            Console.WriteLine("Tearing down");

            if (cmd.IsServer)
            {
                Console.ReadKey();
            }
        }