예제 #1
0
 public MqttConnectionWorker(
     ILogginHandler logginHandler,
     IMqttConnectionManager[] connectionManagers)
 {
     this.logginHandler      = logginHandler;
     this.connectionManagers = connectionManagers;
 }
예제 #2
0
 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>();
 }
예제 #3
0
        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;
 }
예제 #5
0
 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);
 }