Пример #1
0
        /// <inheritdoc cref="Consumer.ConnectCoreAsync" />
        protected override async Task ConnectCoreAsync()
        {
            _clientWrapper = _clientFactory.GetClient(this);

            await _clientWrapper.ConnectAsync(this).ConfigureAwait(false);

            await _clientWrapper.SubscribeAsync(
                Endpoint.Topics.Select(
                    topic =>
                    new MqttTopicFilterBuilder()
                    .WithTopic(topic)
                    .WithQualityOfServiceLevel(Endpoint.QualityOfServiceLevel)
                    .Build())
                .ToArray())
            .ConfigureAwait(false);
        }
Пример #2
0
        /// <inheritdoc cref="Consumer.ConnectCoreAsync" />
        protected override Task ConnectCoreAsync()
        {
            _clientWrapper = _clientFactory.GetClient(this);

            return(_clientWrapper.ConnectAsync(this));
        }