Ejemplo 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.TcpOpenSimpleServerPerformance", out createdProcessWait);
            if (createdProcessWait)
            {
                using (processWait)
                {
#endif
            Console.WriteLine(@"http://www.AutoCSer.com/TcpServer/SimpleMethodServer.html
");
#if !NoAutoCSer
            using (OpenSimpleServer.TcpOpenSimpleServer server = new OpenSimpleServer.TcpOpenSimpleServer())
            {
                if (server.IsListen)
                {
                    if (!startProcess("TcpSimpleClientPerformance", "AutoCSer.TestCase.TcpOpenSimpleClientPerformance"))
                    {
                        Console.WriteLine("未找到 TCP 服务性能测试服务 客户端程序");
                    }
                    Console.WriteLine("Press quit to exit.");
                    while (Console.ReadLine() != "quit")
                    {
                        ;
                    }
                }
                else
                {
                    Console.WriteLine("TCP 服务性能测试服务 启动失败");
                    Console.ReadKey();
                }
            }
#endif
#if !DotNetStandard
        }
    }
#endif
        }
Ejemplo 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.TcpOpenSimpleServerPerformance", out createdProcessWait);
            if (createdProcessWait)
            {
                using (processWait)
                {
#endif
            Console.WriteLine(@"http://www.AutoCSer.com/TcpServer/SimpleMethodServer.html
");
#if !NoAutoCSer
            using (OpenSimpleServer.TcpOpenSimpleServer server = new OpenSimpleServer.TcpOpenSimpleServer())
            {
                if (server.IsListen)
                {
#if DotNetStandard
#if DEBUG
                    FileInfo clientFile = new FileInfo(Path.Combine(AutoCSer.PubPath.ApplicationPath, @"..\..\..\..\TcpSimpleClientPerformance\bin\Debug\netcoreapp2.0\AutoCSer.TestCase.TcpOpenSimpleClientPerformance.dll".pathSeparator()));
#else
                    FileInfo clientFile = new FileInfo(Path.Combine(AutoCSer.PubPath.ApplicationPath, @"..\..\..\..\TcpSimpleClientPerformance\bin\Release\netcoreapp2.0\AutoCSer.TestCase.TcpOpenSimpleClientPerformance.dll".pathSeparator()));
#endif
                    if (!clientFile.Exists)
                    {
                        clientFile = new FileInfo(Path.Combine(AutoCSer.PubPath.ApplicationPath, @"AutoCSer.TestCase.TcpOpenSimpleClientPerformance.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, @"..\..\..\TcpSimpleClientPerformance\bin\Debug\AutoCSer.TestCase.TcpOpenSimpleClientPerformance.exe".pathSeparator()));
#else
                    FileInfo clientFile = new FileInfo(Path.Combine(AutoCSer.PubPath.ApplicationPath, @"..\..\..\TcpSimpleClientPerformance\bin\Release\AutoCSer.TestCase.TcpOpenSimpleClientPerformance.exe".pathSeparator()));
#endif
                    if (!clientFile.Exists)
                    {
                        clientFile = new FileInfo(Path.Combine(AutoCSer.PubPath.ApplicationPath, @"AutoCSer.TestCase.TcpOpenSimpleClientPerformance.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
        }