- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我对 bittorrent 中的位域消息有点困惑.我注意到下面问题形式的困惑。
Bitfield to be sent immediately after the handshaking sequence is completed
我假设这是强制性的,即在握手之后必须跟随一个位域消息。正确吗?
The bitfield message may only be sent immediately after the handshaking sequence is completed, and before any other messages are sent
假设我清楚地阅读了这条消息,尽管它是可选消息。 peer 仍然可以在任何消息之前广播位域消息(如请求、choke、uncoke 等)。对吗?
如果我是正确的,位域代表状态,即对等方是否有给定的部分。
假设我的位域是 [1,1,1,1,1,1,1,1,1,1 ..]
。我确定了一个事实,即对等方缺少第 10 block ,如果位域看起来像这样 [1,1,0,1,1,1,1,1,1,1 ..]
对等方缺少第 3 件。那么第一个字节的高位对应 block 索引0是什么意思。
Spare bits at the end are set to zero
这是什么意思?我的意思是,如果末尾有一点为 0,这并不意味着同行将其视为缺失的部分。为什么要使用备用位。
我对此的直觉是,位域可以更轻松地为一个知道对等点可用的片段找到合适的对等点,但我对此是否正确?
@Encombe
这里是我的位域负载的样子
\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFE
最佳答案
I'm assuming this is compulsory i.e after handshake there must follow a bitfield message. Correct?
不,位域消息是可选的,但如果客户端发送它,它必须是握手后的第一条消息。
此外,在任何一方开始发送任何类型的常规消息(包括位域消息)之前,双方都必须发送完整的握手(即握手序列已完成)。
assuming I read this clear although be optional message. peer can still broadcast the bitfield message prior to any message (like request, choke, uncoke etc). correct ?
是的,见上文。如果客户端向其他任何地方发送位域消息,则必须关闭连接。
Assuming that my bitfield is [1,1,1,1,1,1,1,1,1,1 ..]. I establish the fact that the peer has 10th piece missing
没有。我不清楚您的数字是位 (0b1111111111
) 还是字节 (0x01010101010101010101
)。
如果是位(0b11111111
): 表示有0到9个
如果是bytes(0x01010101010101010101
):表示有第7、15、23、31、39、47、55、63、71、79 block
if the bitfield look like this [1,1,0,1,1,1,1,1,1,1 ..] the peer has a 3rd piece missing.
不,片段是零索引的。 0b1101111111
:表示第 2 block 缺失。
Then what is the high bit in the first byte corresponds to piece index 0 means.
表示索引为0的片由最左边的位表示。 (bigendian 中的最高有效位。)。八位 = 一个字节
。 0b10000000 = 0x80
。 ^
高位设置意味着客户端有 block 0
。 0b00000001 = 0x01
。 ^
低位设置意味着客户端有第 7 block
why is the spare bit used
如果torrent中的 block 数不能被8整除;在位域的最后一个字节中会有一些位,不代表任何部分。这些位必须设置为零。
可以这样计算位域的大小(以字节为单位):size_bitfield = math.ceil(number_of_pieces/8)
备用位数为:spare_bits = 8 * size_bitfield - number_of_pieces
what is the purpose of the bitfield
目的是告诉客户端有哪些片段,以便其他节点知道它可以请求哪些片段。
关于bittorrent - 围绕 Bitfield Torrent 的困惑,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44308457/
我正在使用 BEncoded PHP Library解码来自 Bittorrent 跟踪器的编码响应。 Tracker 的响应是: d5:filesd20:¼€™rÄ2ÞÊþVA .]á^¦d8:
我想知道是否有可能,有一个 torrent 集合(即包含多个文件的 torrent)来提取一个,生成一个几乎新的 torrent/magnet 链接来只下载那个单个文件,但使用相同的来源(宣布等) ,
http://www.torrentreactor.to/torrents_search_rss.php 如何进行 API 调用,然后一旦获得 XML 响应,我想自动选择具有最高编号的单个文件。种子和
我正在尝试通过nodejs 将 torrent 加载到 rtorrent 客户端中。我正在使用插件 node-rtorrent,但我可以编辑它或根据需要使用另一个插件。 所以我想做的是使用 rtorr
如何安装libtorrent在Windows下?另外,是否可以通过将其需要的所有库和文件包含在同一文件夹中来使其可移植? 最佳答案 您有两种途径,使用 Visual C++ 编译 libtorrent
我需要使用 C 修改 torrent 文件中的跟踪器,它们使用什么类型的编码?当我只打印 ascii 字符时,它们打印出乱码。或者有没有直接的方法使用 C 将跟踪器添加到 torrent 文件? 最佳
我想从此链接下载 .torrent 文件 http://torrage.com/torrent/13764753227BCBE3E8E82C058A7D5CE2BDDF9857.torrent为此,我
到目前为止,我还没有找到任何合适的用 javascript 编码的 .torrent 文件解析器,因此我开始创建自己的解析器。 到目前为止,我能够在 javascript 中重新编码 php bdec
我正在尝试使用 BeautifulSoup 解析来自 rarbg.to 的电影页面.我正在尝试收集电影的标题。 所以我的 Python 代码如下: import urllib2 from bs4 im
我正在寻找以编程方式通过 bittorrent 下载具体文件片段(例如第一个或最后一个 1Mb)的方法。C/C++、Java 或 Ruby 库对我来说是很好的解决方案。开源世界有什么解决方案吗? 最佳
我曾经认为我对TCP和UDP协议(protocol)的理解虽然有限,但是是正确的。尽管最近,当我意识到共享同一个 torrent 的对等点可以通过 TCP 或 UDP 协议(protocol)相互连接
本文实例讲述了PHP基于闭包思想实现的torrent文件解析工具。分享给大家供大家参考,具体如下: PHP对静态词法域的支持有点奇怪,内部匿名函数必须在参数列表后面加上use关键字,显式的说明想要
我尝试使用一个检查 .torrent 文件的内容 $ od -c xyz.torrent 文件的一些内容是纯文本的,比如关于跟踪器、创建日期、使用的编码、长度和件数的信息,但其余的都是编码的。有人可以
我想(快速)将程序/脚本放在一起以从 .torrent 文件中读取文件集。然后我想使用该集合从特定目录中删除不属于 torrent 的任何文件。 关于从 .torrent 文件读取此索引的方便库的任何
javascript 中有没有办法检查浏览器是否支持磁力链接(= 检查用户的电脑上是否安装了 torrent 客户端)? 我想通过 JavaScript 检查浏览器是否通过单击磁力链接打开 torre
我无法找到如何为 torrent 文件生成相应信息哈希的问题。这是我到目前为止的代码: InputStream input = null; try { MessageDigest sha1 =
有没有办法使用 MonoTorrent .Net 库从磁力链接生成 .torrent 文件?如果是这样,有人可以举例解释吗?我搜索了该网站并用谷歌搜索,但找不到解决方案。如果不可能,是否有其他 Win
我刚刚使用 uTorrent 下载了一个新的 linux 发行版,并开始想知道 uTorrent(和其他 bittorrent)如何通过 NAT 路由器相互发送文件?他们显然使用跟踪器来获得介绍,但他
我在 python 中创建了一个 torrent 跟踪器,它返回所有播种地址的列表和它们正在播种的端口 我想与他们握手,这样我就可以开始获取碎片并创建 block (下载文件) 到目前为止,我的握手已
我的文件夹中有一个 torrent 文件列表 (2000)。每个 torrent 文件包含大约 500 个可下载文件。总共大约有 100 万个可下载文件。我只想下载其中一些符合特定条件的内容。 我用
我是一名优秀的程序员,十分优秀!