Exemple #1
0
 public EwelinkClientWebSocket(IOptions <EwelinkConfiguration> config)
 {
     _config            = config.Value;
     _webSocket         = new ClientWebSocket();
     _cts               = new CancellationTokenSource();
     _webSocketListener = new Task(async() => await Listen(_webSocket, _cts.Token), TaskCreationOptions.LongRunning);
 }
Exemple #2
0
 public EwelinkClient(HttpClient client,
                      IOptions <EwelinkConfiguration> config,
                      ICryptoService cryptoService,
                      IAuthTokenCacheFactory tokenCacheFactory)
 {
     _httpClient        = client;
     _config            = config.Value;
     _cryptoService     = cryptoService;
     _tokenCacheManager = tokenCacheFactory.Create(this, typeof(EwelinkClient).FullName);
 }