コード例 #1
0
 public JT808RetryClientHostedService(
     JT808RetryBlockingCollection retryBlockingCollection,
     ILoggerFactory loggerFactory,
     IJT808TcpClientFactory jT808TcpClientFactory)
 {
     logger = loggerFactory.CreateLogger <JT808RetryClientHostedService>();
     this.jT808TcpClientFactory = jT808TcpClientFactory;
     RetryBlockingCollection    = retryBlockingCollection;
 }
コード例 #2
0
 public JT808TcpClient(
     JT808DeviceConfig deviceConfig,
     IServiceProvider serviceProvider)
 {
     DeviceConfig                = deviceConfig;
     WriteableTimeout            = DateTime.UtcNow.AddSeconds(DeviceConfig.Heartbeat);
     heartbeatCTS                = new CancellationTokenSource();
     SendAtomicCounterService    = serviceProvider.GetRequiredService <JT808SendAtomicCounterService>();
     ReceiveAtomicCounterService = serviceProvider.GetRequiredService <JT808ReceiveAtomicCounterService>();
     JT808Serializer             = serviceProvider.GetRequiredService <IJT808Config>().GetSerializer();
     Logger   = serviceProvider.GetRequiredService <ILoggerFactory>().CreateLogger <JT808TcpClient>();
     producer = serviceProvider.GetRequiredService <IJT808MessageProducer>();
     RetryBlockingCollection = serviceProvider.GetRequiredService <JT808RetryBlockingCollection>();
 }