protected void DataDownloadComplete(object sender, DownloadDataCompletedEventArgs e) { SecureWebClient client = sender as SecureWebClient; client.DownloadDataCompleted -= DataDownloadComplete; m_downloadDataCompleted.Invoke(e.Result); }
public DownloadManager(int connectionPoolSize) { // HACK: This is not optimal. It overrides all HttpWebRequests and allows them to pass validation ServicePointManager.ServerCertificateValidationCallback += ValidateAllCertificates; // END HACK for (int i = 0; i < connectionPoolSize; ++i) { var client = new SecureWebClient(); client.DownloadFileCompleted += FileDownloadComplete; client.DownloadDataCompleted += DataDownloadComplete; m_connectionPool.Add(client); } }
public void ProcessRequest(SecureWebClient client) { client.DownloadDataCompleted += DataDownloadComplete; client.DownloadDataAsync(new Uri(m_sourceFile)); Debug.Log("Trying to download data: " + m_sourceFile); }
public void ProcessRequest(SecureWebClient client) { client.DownloadFileAsync(new Uri(m_sourceFile), m_destination); }