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.TcpInternalStreamServerPerformance", out createdProcessWait); if (createdProcessWait) { using (processWait) { #endif Console.WriteLine(@"http://www.AutoCSer.com/TcpServer/MethodStreamServer.html "); #if !NoAutoCSer using (InternalStreamServer.TcpInternalStreamServer synchronousServer = new InternalStreamServer.TcpInternalStreamServer()) using (InternalStreamTcpQueueServer.TcpInternalStreamServer tcpQueueServer = new InternalStreamTcpQueueServer.TcpInternalStreamServer()) using (InternalStreamQueueServer.TcpInternalStreamServer queueServer = new InternalStreamQueueServer.TcpInternalStreamServer()) { if (synchronousServer.IsListen && tcpQueueServer.IsListen && queueServer.IsListen) { if (!startProcess("TcpStreamClientPerformance", "AutoCSer.TestCase.TcpInternalStreamClientPerformance")) { Console.WriteLine("未找到 TCP 内部服务性能测试服务 客户端程序"); } Console.WriteLine("Press quit to exit."); while (Console.ReadLine() != "quit") { ; } } else { Console.WriteLine("TCP 内部服务性能测试服务 启动失败"); Console.ReadKey(); } } #endif #if !DotNetStandard } } #endif }
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.TcpInternalStreamServerPerformance", out createdProcessWait); if (createdProcessWait) { using (processWait) { #endif Console.WriteLine(@"http://www.AutoCSer.com/TcpServer/MethodStreamServer.html "); #if !NoAutoCSer using (InternalStreamServer.TcpInternalStreamServer synchronousServer = new InternalStreamServer.TcpInternalStreamServer()) using (InternalStreamTcpQueueServer.TcpInternalStreamServer tcpQueueServer = new InternalStreamTcpQueueServer.TcpInternalStreamServer()) using (InternalStreamQueueServer.TcpInternalStreamServer queueServer = new InternalStreamQueueServer.TcpInternalStreamServer()) { 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.TcpInternalStreamClientPerformance.dll".pathSeparator())); #else FileInfo clientFile = new FileInfo(Path.Combine(AutoCSer.PubPath.ApplicationPath, @"..\..\..\..\TcpStreamClientPerformance\bin\Release\netcoreapp2.0\AutoCSer.TestCase.TcpInternalStreamClientPerformance.dll".pathSeparator())); #endif if (!clientFile.Exists) { clientFile = new FileInfo(Path.Combine(AutoCSer.PubPath.ApplicationPath, @"AutoCSer.TestCase.TcpInternalStreamClientPerformance.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.TcpInternalStreamClientPerformance.exe".pathSeparator())); #else FileInfo clientFile = new FileInfo(Path.Combine(AutoCSer.PubPath.ApplicationPath, @"..\..\..\TcpStreamClientPerformance\bin\Release\AutoCSer.TestCase.TcpInternalStreamClientPerformance.exe".pathSeparator())); #endif if (!clientFile.Exists) { clientFile = new FileInfo(Path.Combine(AutoCSer.PubPath.ApplicationPath, @"AutoCSer.TestCase.TcpInternalStreamClientPerformance.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 }