Beispiel #1
0
        public MqttClientSession(
            string clientId,
            MqttServerOptions options,
            MqttClientSessionsManager sessionsManager,
            IMqttNetLogger logger)
        {
            _sessionsManager = sessionsManager ?? throw new ArgumentNullException(nameof(sessionsManager));
            _logger          = logger ?? throw new ArgumentNullException(nameof(logger));

            ClientId = clientId;

            _options = options;

            _subscriptionsManager = new MqttClientSubscriptionsManager(_options);
            _pendingMessagesQueue = new MqttClientPendingMessagesQueue(_options, this, _logger);
        }
Beispiel #2
0
        public MqttClientSession(
            string clientId,
            IOptions <MqttServerOptions> options,
            MqttClientSessionsManager sessionsManager,
            MqttClientSubscriptionsManager subscriptionsManager,
            ILogger <MqttClientSession> logger,
            ILogger <MqttClientPendingMessagesQueue> messageQueueLogger)
        {
            _sessionsManager      = sessionsManager ?? throw new ArgumentNullException(nameof(sessionsManager));
            _subscriptionsManager = subscriptionsManager ?? throw new ArgumentNullException(nameof(subscriptionsManager));
            _logger = logger ?? throw new ArgumentNullException(nameof(logger));

            ClientId = clientId;

            _options = options.Value;
            _pendingMessagesQueue = new MqttClientPendingMessagesQueue(_options, this, messageQueueLogger);
        }