问题标签 [libtorrent-rasterbar]
For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.
python - Libtorrent - 将整个数据保存在缓存中并稍后刷新
我正在使用 libtorrent 将数据传输到 10k+ 个节点。这里我传输的数据非常小(大小为 10-50 mb)。我希望所有节点都将数据保存在内存中,直到所有其他节点完成下载以避免更多的磁盘 io 使用,然后在所有主机中完成下载后将数据刷新到磁盘。有什么办法吗?
python - Libtorrent 设置 download_limit/upload_limit 不起作用
我想在我的 libtorrent 客户端中限制我的下载/上传速度。我为此使用以下代码。
它应该以 0.1 kb/sec 的速度下载数据,但它仍然以大约 1500 kb/sec 的速度下载数据。
我有什么遗漏吗?
c++ - 使用 set_alert_notify 唤醒主线程的正确方法是什么?
我正在尝试基于 libtorrent rasterbar 编写自己的 torrent 程序,但在让警报机制正常工作时遇到问题。Libtorrent 提供功能
这应该是
该函数的目的是客户端唤醒其主线程,以使用 pop_alerts() 轮询更多警报。如果 notify 函数没有这样做,它将不会被再次调用,直到 pop_alerts 因其他原因被调用。
到目前为止一切顺利,我想我理解了这个功能背后的意图。但是,我的实际实现并没有那么好。到目前为止,我的代码是这样的:
但是有一个竞争条件。如果wait_for_alert
返回NULL
(因为还没有警报)但传递给的函数set_alert_notify
在之前被调用_alert_cw.wait(ul);
,则整个循环将永远等待(因为引用中的第二句)。
目前,我的解决方案只是改变_alert_cv.wait(ul);
为_alert_cv.wait_for(ul, std::chrono::milliseconds(250));
在保持足够低的延迟的同时减少每秒的循环数。
但这确实是比解决方案更多的解决方法,我一直认为必须有适当的方法来处理这个问题。
python - Python/Libtorrent:从磁力链接中检索元数据而不下载文件
我试图只获取 torrent 名称或 torrent 中的文件列表,而不实际下载它们。
这是我当前的代码,它可以运行但速度很慢,因为它会下载 torrent 内容。
我也尝试过使用lt.parse_magnet_uri()
,但这并没有返回我正在寻找的内容,或者任何真正超过信息哈希的东西。
libtorrent - libtorrent 警报 - read_piece_alert
我有一个多文件种子(3 个文件)。我按照此处的说明订阅了 read_piece_alert 。
我如何知道该片段属于多文件种子中的哪个文件?
例如,我的多文件种子有 .AVI、.TXT 和 .JPG。是否有某种索引可以知道该片段实际属于哪个文件?
libtorrent - libtorrent - storage_interface readv explanation
I have implemented a custom storage interface in libtorrent as described in the help section here.
The storage_interface is working fine, although I can't figure out why readv
is only called randomly while downloading a torrent. From my view the overriden virtual function readv
should get called each time I call handle->read_piece
in piece_finished_alert
. It should read the piece for read_piece_alert?
The buffer is provided in read_piece_alert
without getting notified in readv
.
So the question is why it is called only randomly and why it's not called on a read_piece()
call? Is my storage_interface maybe wrong?
The code looks like this:
Intialized with
The function below sets up alerts and invokes read_piece
on each completed piece.
python - Libtorrent:如何获取与会话关联的所有 torrent 句柄?
如果我在会话中添加了多个种子,有什么方法可以从该会话中获取所有句柄?
例如。
是会话有任何方法可以给我与该会话关联的所有句柄的列表。喜欢。
python - 为 libtorrent 构建 BBv2
我正在按照本指南为 构建 libtorrent python 3.6
,但我被困在这部分。
将目录更改为 c:\boost_1_55_0\tools\jam\src。然后在 unix 系统上运行名为 build.bat 或 build.sh 的脚本。
First you need to build bjam. You do this by opening a terminal (In windows, run cmd). Change directory to c:\boost_1_55_0\tools\jam\src. Then run the script called build.bat or build.sh on a unix system. This will build bjam and place it in a directory starting with bin. and then have the name of your platform. Copy the bjam.exe (or bjam on a unix system) to a place that's in you shell's PATH. On linux systems a place commonly used may be /usr/local/bin or on windows c:\windows (you can also add directories to the search paths by modifying the environment variable called PATH).
我在boost
这里使用的是 1.65.1 的最新版本。我所做的就是将其提取到一个文件夹中。
问题
我build.bat
在这个特定的文件夹中看不到我应该用来构建bjam
的文件夹。有没有更清晰的方法在 windows 上为 python 安装 libtorrent?
python - Libtorrent:在magnet_link uri中添加多个跟踪器
我正在尝试在 libtorrent 中使用多个跟踪器。我在 leechers 中直接使用magnet_link 而不是 torrent 文件。在播种时,我可以在 add_tracker() 中添加多个跟踪器。但是当我生成magnet_link时:
我不确定,如何添加多个跟踪器tr="+tracker
生成磁铁链接的播种机端代码:
使用magnet_link的Leecher端代码:
c++ - 链接静态库与共享库问题
我是新手Linux
,很抱歉,如果我的问题真的很愚蠢。
我有共享跨平台库项目,它使用第三方静态库(Libtorrent
)。
Windows
// Android
-macOS
构建和工作正常。
但我不知道如何在Linux
( Ubuntu
) 中使用GCC
.
我收到以下链接器错误:
我已经尝试重建Boost
并Libtorrent
使用-fPIC
标志:没有任何改变。
提升构建脚本:
Libtorrent 构建脚本:
我的共享库本身是一个Qt
基于 - 的库。我使用 构建它Qt Creator
,在 .pro 文件中提供所有必需的头文件和库。