Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.
Sign upPriority questions #956
Priority questions #956
Comments
This comment has been minimized.
This comment has been minimized.
|
2, 3 and 4: I don't know which pieces are prioritized if they are given the same priority. Is it sequential, e.g. lower piece number has a higher priority, or rarest first, or is it not defined at all? |
This comment has been minimized.
This comment has been minimized.
|
Lots of good questions in here. Honestly, it's been so long since I've looked at this code that I'm not sure how it works anymore. Also, I see that you asked this in 2016, so you've probably moved on by now haha I'm planning to rewrite some of this in the near future, so I'll figure it out then. |
I have a couple of questions:
1:
Say file A has a readStream to it and file B is selected. If the peers offer enough bandwidth to download A to fully utilize your own download bandwidth, will file B not start downloading until A is finished? E.g. If your connection is 1000kb/s, and the first and second pieces are selected with highest and lowest priority respectively, but the uploaders for the first piece can only supply 700kb/s while the uploaders for the second piece can supply infinite bandwidth, will the second piece download at 300 kb/s or not at all?
2:
Is there a way to directly set priority to files? E.g. give A priority 1 (highest), B priority 2, C priority 3 and so forth. I guess you could loop through
torrent.files, calculate the byte offset and dotorrent.select()with priority.3:
In
torrent.select(start, end, [priority], [notify]), is priority 1 highest, 2 second highest and so forth? What priority doesfile.select()andfile.createReadStream()have?4:
If you do A.select() then B.select(), does A have a higher priority than B, or vice versa, or equal?
Bonus question:
5:
Do most video players use HTTP range requests when playing a video over HTTP? The seek/play position determines the byte start, but what determines the byte range? Is it the buffer size set in the video player?
Thanks