Microsoft.Protocols.TestManager.Kernel.PipeSinkServer.Start C# (CSharp) Method

Start() public static method

Start PipeSink of PTF.
public static Start ( string pipeName ) : void
pipeName string
return void
        public static void Start(string pipeName)
        {
            listeners = new List<Listener>();
            PipeName = pipeName;
            if (waitingServer == null)
            {
                waitingServer = new NamedPipeServerStream(PipeName, PipeDirection.InOut, NamedPipeServerStream.MaxAllowedServerInstances, PipeTransmissionMode.Message, PipeOptions.Asynchronous);
                waitingServer.BeginWaitForConnection(new AsyncCallback(serverCallback), waitingServer);
            }
            Listener.IgnoreLogs = false;
        }

Usage Example

        private Exception Run(string runArgs)
        {
            try
            {
                vstestProcess = new Process()
                {
                    StartInfo = new ProcessStartInfo()
                    {
                        WorkingDirectory = WorkingDirectory,
                        FileName         = EnginePath,
                        UseShellExecute  = false,
                        CreateNoWindow   = true,
                        Arguments        = runArgs
                    }
                };

                PipeSinkServer.ParseLogMessage = ParseLogMessage;
                PipeSinkServer.Start(PipeName);

                vstestProcess.Start();
                vstestProcess.WaitForExit();
            }
            catch (Exception exception)
            {
                PipeSinkServer.Stop();
                return(exception);
            }
            return(null);
        }
All Usage Examples Of Microsoft.Protocols.TestManager.Kernel.PipeSinkServer::Start