public PipeClient(string pipeName) { this.pipeName = pipeName; client = new PipeBaseForClient(".", this.pipeName, p => p.StartByteReaderAsync()); client.Connect(); client.DataReceived += OnReceive; }
public PipeClient(string pipeName, int timeoutMilliseconds) { this.pipeName = pipeName; client = new PipeBaseForClient(".", this.pipeName, p => p.StartByteReaderAsync()); client.Connect(timeoutMilliseconds); client.DataReceived += OnReceive; }
public bool Wait(int timeout = 10) { timeout *= 40; while (timeout > 0) { Thread.Sleep(25); if (CheckStatusSuccess() == true) { return(true); } timeout -= 1; } if (this.pipeStatus == PipePacketStatus.Pending) { client.Close(); client = new PipeBaseForClient(".", pipeName, p => p.StartByteReaderAsync()); client.Connect(); client.DataReceived += OnReceive; } return(false); }