public SteamCdnServerPool(SteamContentClient steamContentClient, SteamContentServerQualityProvider steamContentServerQualityProvider) { _steamApps = steamContentClient.SteamClient.InternalClient.GetHandler <SteamKit2.SteamApps>(); _steamContentClient = steamContentClient; _steamContentServerQualityProvider = steamContentServerQualityProvider; _steamContentServerQualities = _steamContentServerQualityProvider.Load() ?? new List <SteamContentServerQuality>(); }
public SteamCdnServerPool(SteamContentClient steamContentClient, AppId appId, CancellationToken cancellationToken = default) { _steamContentClient = steamContentClient; _appId = appId; _cancellationTokenSource = CancellationTokenSource.CreateLinkedTokenSource(cancellationToken, new CancellationTokenSource().Token); _availableServerEndpoints = new BlockingCollection <CDNClient.Server>(); _activeServerEndpoints = new ConcurrentStack <CDNClient.Server>(); _populatePoolEvent = new AutoResetEvent(true); _populatedEvent = new AsyncManualResetEvent(false); _populatorTask = Task.Factory.StartNew(MonitorAsync).Unwrap(); CdnClient = new CDNClient(_steamContentClient.SteamClient.InternalClient); }