使用vuze API限制带宽

时间:2015-07-15 12:27:26

标签: java api bittorrent vuze

我正在使用VUze API创建一个JAVA程序,以便在Bittorrent上实现一些实验。 下载torrent时此代码可以正常工作

String url = "500mega.torrent";
    core = AzureusCoreFactory.create();
    core.start();
    // System.out.println("Attempting to download torrent at : " + url);

    File downloadedTorrentFile = new File(url);

    System.out.println("Completed download of : " + url);
    System.out.println("File stored as : "
            + downloadedTorrentFile.getAbsolutePath());

    File downloadDirectory = new File("downloads"); // Destination directory
    if (downloadDirectory.exists() == false)
        downloadDirectory.mkdir();
    COConfigurationManager.initialise();
    GlobalManager globalManager = core.getGlobalManager();
    DownloadManager manager = globalManager.addDownloadManager(
            downloadedTorrentFile.getAbsolutePath(),
            downloadDirectory.getAbsolutePath());
    DownloadManagerListener listener = new DownloadStateListener();
    manager.addListener(listener);

    TransferSpeedValidator.setGlobalDownloadRateLimitBytesPerSecond(100);
    System.out.println(TransferSpeedValidator
            .getGlobalDownloadRateLimitBytesPerSecond());
    globalManager.startAllDownloads();

但是,我找不到限制下载/上传带宽的方法。 Vuze的文档非常糟糕...... 任何帮助将不胜感激。

感谢。

0 个答案:

没有答案