Beispiel #1
0
        public DeviceServer(ProtocolFactory protocolFactory, IServiceProvider services, FanoutHub fanoutHub, IOptions <ProxyOptions> options, IOptions <SqlServerOptions> sqlOptions, ILogger <DeviceServer> logger)
        {
            _fanoutHub = fanoutHub;
            _options   = options.Value;
            _logger    = logger;

            var stackBuilder = new StackBuilder(services);

            if (sqlOptions.Value.ConnectionString != null)
            {
                stackBuilder.Use <SqlServerMiddleware>();
            }

            var stack = stackBuilder.Build();

            _protocol = protocolFactory.Create(_options.ProtocolName, stack);
        }
Beispiel #2
0
 public FanoutServer(FanoutHub fanoutHub, IOptions <ProxyOptions> options, ILogger <FanoutServer> logger)
 {
     _fanoutHub = fanoutHub;
     _options   = options.Value;
     _logger    = logger;
 }