void InspectPacket(byte[] buffer, MqttPacketFlowDirection direction) { try { var eventArgs = new InspectMqttPacketEventArgs { Buffer = buffer, Direction = direction }; _asyncEvent.InvokeAsync(eventArgs).GetAwaiter().GetResult(); } catch (Exception exception) { _logger.Error(exception, "Error while inspecting packet."); } }
void InspectPacket(byte[] buffer, MqttPacketFlowDirection direction) { try { var context = new ProcessMqttPacketContext { Buffer = buffer, Direction = direction }; _packetInspector.ProcessMqttPacket(context); } catch (Exception exception) { _logger.Error(exception, "Error while inspecting packet."); } }