Пример #1
0
 public FileDownloadManager(StatusRepo repo, IEnumerable <Uri> hosts,
                            MultiThreadingSettings multiThreadingSettings, IFileDownloader downloader,
                            Func <ExportLifetimeContext <IHostChecker> > hostChecker)
     : this(
         new HostPicker(
             hosts.Select(
                 x => new Uri(x.ToString().Replace("http://", "zsync://").Replace("https://", "zsyncs://"))),
             multiThreadingSettings,
             hostChecker), repo, downloader)
 {
 }
Пример #2
0
        public HostPicker(IEnumerable <Uri> hosts, MultiThreadingSettings multiThreadingSettings,
                          Func <ExportLifetimeContext <IHostChecker> > hostChecker)
        {
            if (hosts == null)
            {
                throw new ArgumentNullException(nameof(hosts));
            }

            ZsyncIncompatHosts     = new List <Uri>();
            MultiThreadingSettings = multiThreadingSettings;

            _hostChecker = hostChecker().Value;

            foreach (var host in hosts)
            {
                HostStates[host] = 0;
            }
        }