public MqttClientSession(string clientId, MqttServerOptions options, MqttClientSessionsManager mqttClientSessionsManager)
 {
     ClientId = clientId;
     _options = options ?? throw new ArgumentNullException(nameof(options));
     _mqttClientSessionsManager = mqttClientSessionsManager ?? throw new ArgumentNullException(nameof(mqttClientSessionsManager));
     _pendingMessagesQueue      = new MqttClientPendingMessagesQueue(options, this);
 }
예제 #2
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);
        }
예제 #3
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);
        }