Beispiel #1
0
        public bool WaitConnection()
        {
            lock (_locker) {
                ReceivePipe.WaitForConnection();
                var clientPid = OPipeHelper.ReadClientPid(ReceivePipe);
                SendPipe = new NamedPipeClientStream(".", OPipeHelper.GenClientName(_pipeName, clientPid), PipeDirection.Out);
                SendPipe.Connect();
            }

            return(true);
        }
Beispiel #2
0
 public PipeClient(string pipeName)
 {
     ReceivePipe = new NamedPipeServerStream(OPipeHelper.GenClientName(pipeName, Process.GetCurrentProcess().Id), PipeDirection.In, NamedPipeServerStream.MaxAllowedServerInstances, PipeTransmissionMode.Byte, PipeOptions.Asynchronous);
     SendPipe    = new NamedPipeClientStream(".", OPipeHelper.GenServerName(pipeName), PipeDirection.Out);
 }