Example #1
0
        static void SslTest()
        {
            var cert = SslHelper.LoadCert();

            Stream s1, s2;

            (s1, s2) = ProducerConsumerStream.Create();

            Task <SslStream> t1 = SslHelper.GetClientStream(s1);
            Task <SslStream> t2 = SslHelper.GetServerStream(s2, cert);

            Task.WaitAll(t1, t2);

            s1 = t1.Result;
            s2 = t2.Result;

            Task.WaitAll(StreamTest.RunClient(s1), StreamTest.RunServer(s2));
        }
Example #2
0
        static int Run(Options options)
        {
            Console.WriteLine("Starting up...");

            var cert = SslHelper.LoadCert();

            ClientHandler[] clientHandlers;
            if (options.UseLoopback)
            {
                Console.WriteLine("Running in-process over loopback");
                clientHandlers = LoopbackTest.Start(cert, options.Clients, options.MessageSize);
            }
            else
            {
                Console.WriteLine("Running in-process over in-memory stream");
                clientHandlers = InProcTest.Start(cert, options.Clients, options.MessageSize);
            }

            ShowResults(options, clientHandlers);

            return(1);
        }
Example #3
0
 static X509Certificate2 GetX509Certificate(BaseOptions options) =>
 options.UseSsl ? SslHelper.LoadCert() : null;