Monotorrent does not download files

235 views Asked by At

I'm developing an application that needs to download a directory (11 GB in size), via torrent, but it only creates 0 byte files. When testing with a small volume (~ 100 MB) - everything is fine. I tried torrent files from different trackers, nothing happened. What's wrong? Help...

public void InitTorrent(string savePath)
{            
    this.engine = new ClientEngine(new EngineSettings());
    this.savePath = savePath;
    CPBMax = 100;
    CPBMin = 0;
    CPBVal = 0;
}

public void DownloadTorrent(string path)
{            
    Torrent torrent = Torrent.Load(path);

    TorrentManager manager = new TorrentManager(torrent, savePath, new TorrentSettings());

    engine.Register(manager);

    double TorrentSize = manager.Torrent.Size;
    TorrentSize = Math.Round(TorrentSize/(1024 * 1024), 1);
    double TorrentProcess = 0;
    double TorrentDowload = 0;            
    string HashSumm = manager.InfoHash.ToString();
    TProcess = "Проверка мода";            
    if (HashSumm != Hash)
    {
        // Запуск
        manager.Start();                
        bool _running = true;
        TProcess = "Загрузка мода";
        while (_running)
        {
            if (manager.State == TorrentState.Stopped)
            {
                _running = false;
            }

            BTNPlayEn = 0;
            TorrentDowload = manager.Monitor.DataBytesDownloaded;
            TorrentProcess = Math.Round(manager.Progress, 1);

            if (manager.Progress > 0.0 ^ engine.TotalDownloadSpeed > 0.0)
            {
                CPBIndet = 0;
            }
            CPBVal = TorrentProcess;
            Version = "Загружено: " + Math.Round((TorrentSize * TorrentProcess)/100, 1) + "/" + TorrentSize + " Mb" + "  ⇓ " + Math.Round(engine.TotalDownloadSpeed / 1024.0, 1) + " kB/sec";
        }
        Version = "Завершено";
        //CPBIndet = 0;
        if (TorrentProcess == 100)
        {
            Hash = HashSumm;
            TProcess = "Готов к запуску";
            BTNPlayContent = "Играть";
            BTNPlayEn = 1;
            // CPBIndet = 0;
        }
        SetSettings();
    }
    else
    {
        TProcess = "Готов к запуску";
        //CPBIndet = 0;
    }
}
0

There are 0 answers