private async void OnOutOfFrameByteReceived(object sender, OutOfFrameByteReceivedEventArgs e) { await this.EnqueueLogOperation( () => this.logger.LogData(LogNames.OutOfFrameByte, LogNames.Receive, new[] { e.Value }, 0, 1)); this.OnEvent(this.OutOfFrameByteReceived, e); }
private Task ProcessIncomingOutOfFrameByte(OutOfFrameByteReceivedEventArgs e) { try { var expected = this.logReader.GetPayload()[0]; if (expected != e.Value) { var msg = "The expected payload does not match the actual received payload, see Data for details."; throw new S101Exception(msg) { Data = { { "Expected", expected }, { "Actual", e.Value } } }; } } catch (Exception ex) { this.done.TrySetException(ex); return(Task.FromResult(false)); } return(this.SendMessagesAsync()); }
private Task ProcessIncomingOutOfFrameByte(OutOfFrameByteReceivedEventArgs e) { try { var expected = this.logReader.GetPayload()[0]; if (expected != e.Value) { var msg = "The expected payload does not match the actual received payload, see Data for details."; throw new S101Exception(msg) { Data = { { "Expected", expected }, { "Actual", e.Value } } }; } } catch (Exception ex) { this.done.TrySetException(ex); return Task.FromResult(false); } return this.SendMessagesAsync(); }
private async void OnOutOfFrameByteReceived(object sender, OutOfFrameByteReceivedEventArgs e) { await this.taskQueue.Enqueue(() => this.ProcessIncomingOutOfFrameByte(e)); }