コード例 #1
0
        static void Main(string[] args)
        {
            bool            createdProcessWait;
            EventWaitHandle processWait = new EventWaitHandle(false, EventResetMode.ManualReset, "AutoCSer.TestCase.TcpInternalServerPerformance", out createdProcessWait);

            if (createdProcessWait)
            {
                Console.WriteLine(@"http://www.AutoCSer.com/TcpServer/MethodServer.html
");
#if NoAutoCSer
#else
                using (processWait)
                    using (InternalServer.TcpInternalServer server = new InternalServer.TcpInternalServer())
                    {
                        if (server.IsListen)
                        {
#if DEBUG
                            FileInfo clientFile = new FileInfo(Path.Combine(AutoCSer.PubPath.ApplicationPath, @"..\..\..\TcpClientPerformance\bin\Debug\AutoCSer.TestCase.TcpInternalClientPerformance.exe".pathSeparator()));
#else
                            FileInfo clientFile = new FileInfo(Path.Combine(AutoCSer.PubPath.ApplicationPath, @"..\..\..\TcpClientPerformance\bin\Release\AutoCSer.TestCase.TcpInternalClientPerformance.exe".pathSeparator()));
#endif
                            if (!clientFile.Exists)
                            {
                                clientFile = new FileInfo(Path.Combine(AutoCSer.PubPath.ApplicationPath, @"AutoCSer.TestCase.TcpInternalClientPerformance.exe"));
                            }
                            if (clientFile.Exists)
                            {
                                Process.Start(clientFile.FullName);
                            }
                            else
                            {
                                Console.WriteLine("未找到 TCP 内部服务性能测试服务 客户端程序");
                            }
                            Console.WriteLine("Press quit to exit.");
                            while (Console.ReadLine() != "quit")
                            {
                                ;
                            }
                        }
                        else
                        {
                            Console.WriteLine("TCP 内部服务性能测试服务 启动失败");
                            Console.ReadKey();
                        }
                    }
#endif
            }
        }
コード例 #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.TcpInternalServerPerformance", out createdProcessWait);
            if (createdProcessWait)
            {
                using (processWait)
                {
#endif
            Console.WriteLine(@"http://www.AutoCSer.com/TcpServer/MethodServer.html
");
#if !NoAutoCSer
            using (InternalServer.TcpInternalServer server = new InternalServer.TcpInternalServer())
            {
                if (server.IsListen)
                {
                    if (!startProcess("TcpClientPerformance", "AutoCSer.TestCase.TcpInternalClientPerformance"))
                    {
                        Console.WriteLine("未找到 TCP 内部服务性能测试服务 客户端程序");
                    }
                    Console.WriteLine("Press quit to exit.");
                    while (Console.ReadLine() != "quit")
                    {
                        ;
                    }
                }
                else
                {
                    Console.WriteLine("TCP 内部服务性能测试服务 启动失败");
                    Console.ReadKey();
                }
            }
#endif
#if !DotNetStandard
        }
    }
#endif
        }
コード例 #3
0
ファイル: Program.cs プロジェクト: zlzforever/AutoCSer
        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.TcpInternalServerPerformance", out createdProcessWait);
            if (createdProcessWait)
            {
                using (processWait)
                {
#endif
            Console.WriteLine(@"http://www.AutoCSer.com/TcpServer/MethodServer.html
");
#if !NoAutoCSer
            using (InternalServer.TcpInternalServer server = new InternalServer.TcpInternalServer())
            {
                if (server.IsListen)
                {
#if DotNetStandard
#if DEBUG
                    FileInfo clientFile = new FileInfo(Path.Combine(AutoCSer.PubPath.ApplicationPath, @"..\..\..\..\TcpClientPerformance\bin\Debug\netcoreapp2.0\AutoCSer.TestCase.TcpInternalClientPerformance.dll".pathSeparator()));
#else
                    FileInfo clientFile = new FileInfo(Path.Combine(AutoCSer.PubPath.ApplicationPath, @"..\..\..\..\TcpClientPerformance\bin\Release\netcoreapp2.0\AutoCSer.TestCase.TcpInternalClientPerformance.dll".pathSeparator()));
#endif
                    if (!clientFile.Exists)
                    {
                        clientFile = new FileInfo(Path.Combine(AutoCSer.PubPath.ApplicationPath, @"AutoCSer.TestCase.TcpInternalClientPerformance.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, @"..\..\..\TcpClientPerformance\bin\Debug\AutoCSer.TestCase.TcpInternalClientPerformance.exe".pathSeparator()));
#else
                    FileInfo clientFile = new FileInfo(Path.Combine(AutoCSer.PubPath.ApplicationPath, @"..\..\..\TcpClientPerformance\bin\Release\AutoCSer.TestCase.TcpInternalClientPerformance.exe".pathSeparator()));
#endif
                    if (!clientFile.Exists)
                    {
                        clientFile = new FileInfo(Path.Combine(AutoCSer.PubPath.ApplicationPath, @"AutoCSer.TestCase.TcpInternalClientPerformance.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
        }