public void StartClient(string pipeNameInput, string pipeNameOutput) { _inClient = new AnonymousPipeClientStream(PipeDirection.In, pipeNameInput); _outClient = new AnonymousPipeClientStream(PipeDirection.Out, pipeNameOutput); _readStream = new StreamString(_inClient); _writeStream = new StreamString(_outClient); }
public void StartServer(StartProcessDelegate startProcess) { _outServer = new AnonymousPipeServerStream(PipeDirection.Out, HandleInheritability.Inheritable); _inServer = new AnonymousPipeServerStream(PipeDirection.In, HandleInheritability.Inheritable); _readStream = new StreamString(_inServer); _writeStream = new StreamString(_outServer); startProcess(_outServer.GetClientHandleAsString(), _inServer.GetClientHandleAsString()); _outServer.DisposeLocalCopyOfClientHandle(); _inServer.DisposeLocalCopyOfClientHandle(); }
public void StartServer(StartProcessDelegate startProcess, bool disposeLocalClientHandle = true) { ArgUtil.NotNull(startProcess, nameof(startProcess)); _outServer = new AnonymousPipeServerStream(PipeDirection.Out, HandleInheritability.Inheritable); _inServer = new AnonymousPipeServerStream(PipeDirection.In, HandleInheritability.Inheritable); _readStream = new StreamString(_inServer); _writeStream = new StreamString(_outServer); startProcess(_outServer.GetClientHandleAsString(), _inServer.GetClientHandleAsString()); if (disposeLocalClientHandle) { _outServer.DisposeLocalCopyOfClientHandle(); _inServer.DisposeLocalCopyOfClientHandle(); } }