public DownloadService(DownloadConfiguration options) : this() { if (options != null) { Package.Options = options.Clone() as DownloadConfiguration; } }
public DownloadService(DownloadConfiguration options) : this() { if (options != null) { Options = options; } }
public Download( DownloadPackage package, DownloadConfiguration configuration) { downloadService = new DownloadService(configuration); Package = package; Status = DownloadStatus.Stopped; }
public DownloadService(DownloadConfiguration options = null) { Package = new DownloadPackage { Options = options ?? new DownloadConfiguration() }; ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls | SecurityProtocolType.Tls11 | SecurityProtocolType.Tls12; ServicePointManager.Expect100Continue = false; // accept the request for POST, PUT and PATCH verbs ServicePointManager.DefaultConnectionLimit = 1000; ServicePointManager.MaxServicePointIdleTime = 1000; }
public DownloadService(DownloadConfiguration options = null) { Package = new DownloadPackage() { Options = options ?? new DownloadConfiguration() }; ServicePointManager.Expect100Continue = false; // accept the request for POST, PUT and PATCH verbs ServicePointManager.DefaultConnectionLimit = 100; ServicePointManager.MaxServicePointIdleTime = 1000; Cts = new CancellationTokenSource(); }
public Download( string url, string path, string filename, DownloadConfiguration configuration) { downloadService = configuration is not null ? new DownloadService(configuration) : new DownloadService(); Url = url; Folder = path; Filename = filename; Status = DownloadStatus.Created; }
public static string AddTask(string url, string name, string savePath = null, int threadCount = 4, int blockSize = 3) { MaxThread = threadCount; DownloadConfiguration configuration = new DownloadConfiguration(); configuration.SaveDirectory = savePath ?? configuration.SaveDirectory; configuration.ChunkCount = blockSize; configuration.TempDirectory = "C:\\temp"; DownloadPackage package = new DownloadPackage { Options = configuration, Address = new Uri(url), FileName = name, SaveDirectory = configuration.SaveDirectory }; _downloadPackages.Add(package); return(package.DId); }
// ReSharper disable once MemberCanBePrivate.Global public DownloadService() { _bandwidth = new Bandwidth(); Options = new DownloadConfiguration(); Package = new DownloadPackage(); // This property selects the version of the Secure Sockets Layer (SSL) or // existing connections aren't changed. ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls | SecurityProtocolType.Tls11 | SecurityProtocolType.Tls12; // Accept the request for POST, PUT and PATCH verbs ServicePointManager.Expect100Continue = false; // Note: Any changes to the DefaultConnectionLimit property affect both HTTP 1.0 and HTTP 1.1 connections. // It is not possible to separately alter the connection limit for HTTP 1.0 and HTTP 1.1 protocols. ServicePointManager.DefaultConnectionLimit = 1000; // Set the maximum idle time of a ServicePoint instance to 10 seconds. // After the idle time expires, the ServicePoint object is eligible for // garbage collection and cannot be used by the ServicePointManager object. ServicePointManager.MaxServicePointIdleTime = 10000; }
public ChunkDownloader(Chunk chunk, DownloadConfiguration config) { Chunk = chunk; Configuration = config; }
public ChunkHub(DownloadConfiguration config) { _configuration = config; }
public DownloadBuilder WithConfiguration(DownloadConfiguration configuration) { downloadConfiguration = configuration; return(this); }
public static IDownload Build(DownloadPackage package, DownloadConfiguration downloadConfiguration) { return(new Download(package, downloadConfiguration)); }
public ChunkDownloader(Chunk chunk, DownloadConfiguration config) { Chunk = chunk; Configuration = config; Configuration.PropertyChanged += ConfigurationPropertyChanged; }