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); }
public FanoutServer(FanoutHub fanoutHub, IOptions <ProxyOptions> options, ILogger <FanoutServer> logger) { _fanoutHub = fanoutHub; _options = options.Value; _logger = logger; }