Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Priority questions #956

Closed
tsoernes opened this issue Oct 21, 2016 · 2 comments
Closed

Priority questions #956

tsoernes opened this issue Oct 21, 2016 · 2 comments

Comments

@tsoernes
Copy link

@tsoernes tsoernes commented Oct 21, 2016

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 do torrent.select() with priority.

3:
In torrent.select(start, end, [priority], [notify]), is priority 1 highest, 2 second highest and so forth? What priority does file.select() and file.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

@tsoernes

This comment has been minimized.

Copy link
Author

@tsoernes tsoernes commented Oct 23, 2016

2, 3 and 4:
Priority can be any number. Higher number is higher priority. file.select() defaults to priority 0, but as far as I can tell it's actually possible to pass a priority with the method, e.g. file.select(2). file.createReadStream has priority 1.

@feross

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?

@stale stale bot added the stale label May 3, 2018
@webtorrent webtorrent deleted a comment from stale bot May 4, 2018
@stale stale bot removed the stale label May 4, 2018
@feross

This comment has been minimized.

Copy link
Member

@feross feross commented May 4, 2018

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.

@feross feross closed this May 4, 2018
@lock lock bot locked as resolved and limited conversation to collaborators Aug 2, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants
You can’t perform that action at this time.