Ejemplo n.º 1
0
        async Task <MqttApplicationMessageReceivedEventArgs> HandleReceivedApplicationMessageAsync(MqttPublishPacket publishPacket)
        {
            var applicationMessage = _adapter.PacketFormatterAdapter.DataConverter.CreateApplicationMessage(publishPacket);
            var eventArgs          = new MqttApplicationMessageReceivedEventArgs(Options.ClientId, applicationMessage);

            var handler = ApplicationMessageReceivedHandler;

            if (handler != null)
            {
                await handler.HandleApplicationMessageReceivedAsync(eventArgs).ConfigureAwait(false);
            }

            return(eventArgs);
        }