Ejemplo n.º 1
0
        private async Task OnReceivedNanoMessageAsync(NanoMessage nanoMessage)
        {
            Interlocked.Increment(ref _rxCount);

            if (nanoMessage.PublishMessage != null)
            {
                await OnReceivedPublishMessageAsync(nanoMessage.PublishMessage);
            }

            if (nanoMessage.IsAckRequested)
            {
                EnqueueMessage(nanoMessage.CreateAckMessage(0));
            }
        }
Ejemplo n.º 2
0
        private async Task OnNanoMessageAsync(NanoMessage nanoMessage)
        {
            Interlocked.Increment(ref _rxCount);

            if (nanoMessage.PublishMessage != null)
            {
                await PublishAsync(nanoMessage.ClientId, nanoMessage.PublishMessage).ConfigureAwait(false);
            }
            if (nanoMessage.SubscribeMessage != null)
            {
                Subscribe(nanoMessage.ClientId, nanoMessage.SubscribeMessage);
            }

            if (nanoMessage.IsAckRequested)
            {
                EnqueueMessage(nanoMessage.CreateAckMessage(0));
            }
        }