public MqttConnectionWorker( ILogginHandler logginHandler, IMqttConnectionManager[] connectionManagers) { this.logginHandler = logginHandler; this.connectionManagers = connectionManagers; }
public MqttBroker(IServiceProvider serviceProvider) { loggingHandler = serviceProvider.GetService <ILogginHandler>(); connectionWorker = serviceProvider.GetService <IMqttConnectionWorker>(); loadbalancingWorker = serviceProvider.GetService <IMqttLoadbalancingWorker>(); socketListener = serviceProvider.GetService <IMqttAsyncTcpSocketListener>(); keepAliveWorker = serviceProvider.GetService <IMqttKeepAliveWorker>(); publishingWorker = serviceProvider.GetService <IMqttPublishingWorker>(); retainedMessageWorker = serviceProvider.GetService <IMqttRetainedMessageWorker>(); securityManager = serviceProvider.GetService <IMqttSecurityManager>(); }
public MqttConnectionPoolManager(IMqttConnectionFactory connectionFactory, IMqttTcpReceiver receiver, ILogginHandler logginHandler, IOptions <MqttNetworkOptions> networkOptions) { this.logginHandler = logginHandler; numberOfConnectionsGotten = 0; numberOfConnectionsReturned = 0; unconnectedClientPool = new ConcurrentStack <MqttConnection>(); var connections = connectionFactory.Create(networkOptions.Value.MaxConnections, networkOptions.Value.ReadAndSendBufferSize); for (var i = 0; i < networkOptions.Value.MaxConnections; i++) { connections[i].ReceiveSocketAsyncEventArgs.Completed += receiver.ReceiveCompleted; unconnectedClientPool.Push(connections[i]); } }
public MqttRetainedMessageWorker(IMqttRetainedMessageManager retainedMessageManager, ILogginHandler logginHandler) { this.retainedMessageManager = retainedMessageManager; this.logginHandler = logginHandler; }
public MqttPublishingWorker(ILogginHandler logginHandler, IMqttPublishingManager publishingManager) { this.logginHandler = logginHandler; this.publishingManager = publishingManager; }
public MqttLoadbalancingManager(ILogginHandler logginHandler, IMqttConnectionManager[] connectionManagers) { this.logginHandler = logginHandler; this.connectionManagers = connectionManagers; loadbalanceAwaitHandler = new AutoResetEvent(false); }