Exemplo n.º 1
0
            protected void DataDownloadComplete(object sender, DownloadDataCompletedEventArgs e)
            {
                SecureWebClient client = sender as SecureWebClient;

                client.DownloadDataCompleted -= DataDownloadComplete;
                m_downloadDataCompleted.Invoke(e.Result);
            }
Exemplo n.º 2
0
        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);
            }
        }
Exemplo n.º 3
0
 public void ProcessRequest(SecureWebClient client)
 {
     client.DownloadDataCompleted += DataDownloadComplete;
     client.DownloadDataAsync(new Uri(m_sourceFile));
     Debug.Log("Trying to download data: " + m_sourceFile);
 }
Exemplo n.º 4
0
 public void ProcessRequest(SecureWebClient client)
 {
     client.DownloadFileAsync(new Uri(m_sourceFile), m_destination);
 }