예제 #1
0
 async void RetransmitNextPublishRelease(IChannelHandlerContext context, CompletionPendingMessageState messageInfo)
 {
     try
     {
         var packet = new PubRelPacket
         {
             PacketId = messageInfo.PacketId
         };
         await this.pubRelPubCompProcessor.RetransmitAsync(context, packet, messageInfo);
     }
     catch (Exception ex)
     {
         ShutdownOnError(context, "<- PUBREL (retransmission)", ex);
     }
 }
        async Task AcknowledgePublishCompleteAsync(IChannelHandlerContext context, CompletionPendingMessageState message)
        {
            this.ResumeReadingIfNecessary(context);

            try
            {
                await message.FeedbackChannel.CompleteAsync();

                await this.qos2StateProvider.DeleteMessageAsync(this.identity, message.PacketId, message.DeliveryState);

                PerformanceCounters.OutboundMessageProcessingTime.Register(message.StartTimestamp);
            }
            catch (Exception ex)
            {
                ShutdownOnError(context, "-> PUBCOMP", ex);
            }
        }
예제 #3
0
        async Task AcknowledgePublishCompleteAsync(IChannelHandlerContext context, CompletionPendingMessageState message)
        {
            this.ResumeReadingIfNecessary(context);

            try
            {
                await this.messagingServiceClient.CompleteAsync(message.LockToken);

                await this.qos2StateProvider.DeleteMessageAsync(this.identity, message.PacketId, message.DeliveryState);

                PerformanceCounters.OutboundMessageProcessingTime.Register(message.StartTimestamp);

                if (this.pubRelPubCompProcessor.ResumeRetransmission(context))
                {
                    return;
                }

                this.RestartReceiveIfPossible(context);
            }
            catch (Exception ex)
            {
                ShutdownOnError(context, "-> PUBCOMP", ex);
            }
        }
 async void RetransmitNextPublishRelease(IChannelHandlerContext context, CompletionPendingMessageState messageInfo)
 {
     try
     {
         var packet = new PubRelPacket
         {
             PacketId = messageInfo.PacketId
         };
         await this.pubRelPubCompProcessor.RetransmitAsync(context, packet, messageInfo);
     }
     catch (Exception ex)
     {
         ShutdownOnError(context, "<- PUBREL (retransmission)", ex);
     }
 }
        async Task AcknowledgePublishCompleteAsync(IChannelHandlerContext context, CompletionPendingMessageState message)
        {
            this.ResumeReadingIfNecessary(context);

            try
            {
                await this.iotHubClient.CompleteAsync(message.LockToken);

                await this.qos2StateProvider.DeleteMessageAsync(message.PacketId, message.DeliveryState);

                PerformanceCounters.OutboundMessageProcessingTime.Register(message.StartTimestamp);

                if (this.pubRelPubCompProcessor.ResumeRetransmission(context))
                {
                    return;
                }

                this.RestartReceiveIfPossible(context);
            }
            catch (Exception ex)
            {
                ShutdownOnError(context, "-> PUBCOMP", ex);
            }
        }