예제 #1
0
        public void DownloadTest()
        {
            BasicDownloader dl      = new BasicDownloader();
            Random          rand    = new Random();
            long            matchid = 3607300000 + rand.Next(10000, 55555);

            Console.WriteLine("Attempting to download the following match: {0}", matchid);
            int result = dl.Download(matchid);

            Console.WriteLine(result);
        }
예제 #2
0
        public void DownloadRangeTest()
        {
            //define the range to download
            long Lowest  = 3607300500;
            long highest = Lowest + 300L; //just gonna grab a couple hundred

            BasicDownloader dl = new BasicDownloader();

            dl.DataWritten        += OnDataWrite; //subscribe to write events
            dl.DownloadIsFinished += OnFinished;
            Console.WriteLine("Downloading from {0} to {1}", Lowest, highest);
            dl.DownloadRange(Lowest, highest);
            //wait for finish
            int MaxTimeout      = 600; //i don know man 10 minutes seems plenty long enough
            int CurrentWaitTime = 0;

            while (CurrentWaitTime <= MaxTimeout && Finished == false)
            {
                //waity wait
                System.Threading.Thread.Sleep(10000); //chill out for 10s
            }
        }
예제 #3
0
        public void DisposeTest()
        {
            BasicDownloader dl = new BasicDownloader();

            dl.Dispose();
        }