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); }
public MqttServer( IOptions <MqttServerOptions> options, IEnumerable <IMqttServerAdapter> adapters, ILogger <MqttServer> logger, MqttClientSessionsManager clientSessionsManager, IMqttClientRetainedMessageManager clientRetainedMessageManager) { _options = options.Value ?? throw new ArgumentNullException(nameof(options)); _logger = logger ?? throw new ArgumentNullException(nameof(logger)); _clientSessionsManager = clientSessionsManager ?? throw new ArgumentNullException(nameof(clientSessionsManager)); _clientRetainedMessageManager = clientRetainedMessageManager ?? throw new ArgumentNullException(nameof(clientRetainedMessageManager)); if (adapters == null) { throw new ArgumentNullException(nameof(adapters)); } _adapters = adapters.ToList(); _clientSessionsManager.ApplicationMessageReceived += (s, e) => ApplicationMessageReceived?.Invoke(s, e); _clientSessionsManager.ClientConnected += OnClientConnected; _clientSessionsManager.ClientDisconnected += OnClientDisconnected; }
public MqttClientSessionsManager(MqttServerOptions options) { _options = options ?? throw new ArgumentNullException(nameof(options)); }
public MqttClientSubscriptionsManager(IOptions <MqttServerOptions> options) { _options = options?.Value ?? throw new ArgumentNullException(nameof(options)); }
public MqttClientSessionsManager(MqttServerOptions options) { _options = options ?? throw new ArgumentNullException(nameof(options)); RetainedMessagesManager = new MqttClientRetainedMessagesManager(options); }
public MqttClientPendingMessagesQueue(MqttServerOptions options, MqttClientSession session, ILogger <MqttClientPendingMessagesQueue> logger) { _logger = logger ?? throw new ArgumentNullException(nameof(logger)); _session = session ?? throw new ArgumentNullException(nameof(session)); _options = options ?? throw new ArgumentNullException(nameof(options)); }
public MqttClientMessageQueue(MqttServerOptions options) { _options = options ?? throw new ArgumentNullException(nameof(options)); }
public MqttClientRetainedMessagesManager(IOptions <MqttServerOptions> options, ILogger <MqttClientRetainedMessagesManager> logger) { _logger = logger ?? throw new ArgumentNullException(nameof(logger)); _options = options.Value ?? throw new ArgumentNullException(nameof(options)); }
public MqttClientSessionsManager(MqttServerOptions options, MqttRetainedMessagesManager retainedMessagesManager, IMqttNetLogger logger) { _logger = logger ?? throw new ArgumentNullException(nameof(logger)); _options = options ?? throw new ArgumentNullException(nameof(options)); _retainedMessagesManager = retainedMessagesManager ?? throw new ArgumentNullException(nameof(retainedMessagesManager)); }