首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >用vuze API限制带宽

用vuze API限制带宽
EN

Stack Overflow用户
提问于 2015-07-15 12:27:25
回答 1查看 99关注 0票数 1

我正在使用JAVA创建一个VUze程序,以便在Bittorrent上实现一些实验。此代码在下载洪流时运行良好。

代码语言:javascript
复制
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的文件太糟糕了..。任何帮助都将不胜感激。

谢谢。

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2015-07-15 13:16:02

全局速度限制是设置。它们存储在字符串键映射中,可以在org.gudy.azureus2.core3.config.impl.ConfigurationDefaults.ConfigurationDefaults()中找到许多默认值。

由于设置都存储在单个实例中,所以可以通过静态方法(如org.gudy.azureus2.core3.config.COConfigurationManager.setParameter(String, int) )来设置设置。

注意,这些都是内部API。它们相当稳定,但不如插件API

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/31430382

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档