Exemplo n.º 1
0
        static void Main(string[] args)
        {
#if DotNetStandard
            Console.WriteLine("WARN : Linux .NET Core not support name EventWaitHandle");
#else
            bool            createdProcessWait;
            EventWaitHandle processWait = new EventWaitHandle(false, EventResetMode.ManualReset, "AutoCSer.TestCase.TcpOpenStreamServerPerformance", out createdProcessWait);
            if (createdProcessWait)
            {
                using (processWait)
                {
#endif
            Console.WriteLine(@"http://www.AutoCSer.com/TcpServer/MethodStreamServer.html
");
#if !NoAutoCSer
            using (OpenStreamServer.TcpOpenStreamServer synchronousServer = new OpenStreamServer.TcpOpenStreamServer())
                using (OpenStreamTcpQueueServer.TcpOpenStreamServer tcpQueueServer = new OpenStreamTcpQueueServer.TcpOpenStreamServer())
                    using (OpenStreamQueueServer.TcpOpenStreamServer queueServer = new OpenStreamQueueServer.TcpOpenStreamServer())
                    {
                        if (synchronousServer.IsListen && tcpQueueServer.IsListen && queueServer.IsListen)
                        {
                            if (!startProcess("TcpStreamClientPerformance", "AutoCSer.TestCase.TcpOpenStreamClientPerformance"))
                            {
                                Console.WriteLine("未找到 TCP 服务性能测试服务 客户端程序");
                            }
                            Console.WriteLine("Press quit to exit.");
                            while (Console.ReadLine() != "quit")
                            {
                                ;
                            }
                        }
                        else
                        {
                            Console.WriteLine("TCP 服务性能测试服务 启动失败");
                            Console.ReadKey();
                        }
                    }
#endif
#if !DotNetStandard
        }
    }
#endif
        }
Exemplo n.º 2
0
        static void Main(string[] args)
        {
#if DotNetStandard
            Console.WriteLine("WARN : Linux .NET Core not support name EventWaitHandle");
#else
            bool            createdProcessWait;
            EventWaitHandle processWait = new EventWaitHandle(false, EventResetMode.ManualReset, "AutoCSer.TestCase.TcpOpenStreamServerPerformance", out createdProcessWait);
            if (createdProcessWait)
            {
                using (processWait)
                {
#endif
            Console.WriteLine(@"http://www.AutoCSer.com/TcpServer/MethodStreamServer.html
");
#if !NoAutoCSer
            using (OpenStreamServer.TcpOpenStreamServer synchronousServer = new OpenStreamServer.TcpOpenStreamServer())
                using (OpenStreamTcpQueueServer.TcpOpenStreamServer tcpQueueServer = new OpenStreamTcpQueueServer.TcpOpenStreamServer())
                    using (OpenStreamQueueServer.TcpOpenStreamServer queueServer = new OpenStreamQueueServer.TcpOpenStreamServer())
                    {
                        if (synchronousServer.IsListen && tcpQueueServer.IsListen && queueServer.IsListen)
                        {
#if DotNetStandard
#if DEBUG
                            FileInfo clientFile = new FileInfo(Path.Combine(AutoCSer.PubPath.ApplicationPath, @"..\..\..\..\TcpStreamClientPerformance\bin\Debug\netcoreapp2.0\AutoCSer.TestCase.TcpOpenStreamClientPerformance.dll".pathSeparator()));
#else
                            FileInfo clientFile = new FileInfo(Path.Combine(AutoCSer.PubPath.ApplicationPath, @"..\..\..\..\TcpStreamClientPerformance\bin\Release\netcoreapp2.0\AutoCSer.TestCase.TcpOpenStreamClientPerformance.dll".pathSeparator()));
#endif
                            if (!clientFile.Exists)
                            {
                                clientFile = new FileInfo(Path.Combine(AutoCSer.PubPath.ApplicationPath, @"AutoCSer.TestCase.TcpOpenStreamClientPerformance.dll"));
                            }
                            if (clientFile.Exists)
                            {
                                ProcessStartInfo process = new ProcessStartInfo("dotnet", clientFile.FullName);
                                process.UseShellExecute = true;
                                Process.Start(process);
                            }
#else
#if DEBUG
                            FileInfo clientFile = new FileInfo(Path.Combine(AutoCSer.PubPath.ApplicationPath, @"..\..\..\TcpStreamClientPerformance\bin\Debug\AutoCSer.TestCase.TcpOpenStreamClientPerformance.exe".pathSeparator()));
#else
                            FileInfo clientFile = new FileInfo(Path.Combine(AutoCSer.PubPath.ApplicationPath, @"..\..\..\TcpStreamClientPerformance\bin\Release\AutoCSer.TestCase.TcpOpenStreamClientPerformance.exe".pathSeparator()));
#endif
                            if (!clientFile.Exists)
                            {
                                clientFile = new FileInfo(Path.Combine(AutoCSer.PubPath.ApplicationPath, @"AutoCSer.TestCase.TcpOpenStreamClientPerformance.exe"));
                            }
                            if (clientFile.Exists)
                            {
                                Process.Start(clientFile.FullName);
                            }
#endif
                            else
                            {
                                Console.WriteLine("未找到 TCP 服务性能测试服务 客户端程序");
                            }
                            Console.WriteLine("Press quit to exit.");
                            while (Console.ReadLine() != "quit")
                            {
                                ;
                            }
                        }
                        else
                        {
                            Console.WriteLine("TCP 服务性能测试服务 启动失败");
                            Console.ReadKey();
                        }
                    }
#endif
#if !DotNetStandard
        }
    }
#endif
        }