public async void Process() { while (true) { if (pipeClientStream.IsConnected) { var ipcMessage = new byte[1]; if (await pipeClientStream.ReadAsync(ipcMessage, 0, 1) > 0) await ProcessPacket(ipcMessage[0], pipeClientStream); } } }