예제 #1
0
        private async Task LoadFastResumeData()
        {
            try
            {
                var fastResumeData = await File.ReadAllBytesAsync(FastResumeFile);

                var fastResume = BEncodedValue.Decode <BEncodedDictionary>(fastResumeData);
                Console.WriteLine("Fast resume data found initializing torrent with existing data.");
                if (fastResume.ContainsKey(_manager.InfoHash.ToHex()))
                {
                    var fastResumeForTorrent = new FastResume((BEncodedDictionary)fastResume[_manager.InfoHash.ToHex()]);
                    _manager.LoadFastResume(fastResumeForTorrent);
                }
            }
            catch (FileNotFoundException)
            {
                Console.WriteLine("No fast resume data found starting fresh torrent.");
            }
        }