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

ideas for ending an active push #9

Open
joehand opened this issue May 15, 2018 · 3 comments
Open

ideas for ending an active push #9

joehand opened this issue May 15, 2018 · 3 comments

Comments

@joehand
Copy link
Owner

joehand commented May 15, 2018

Two ideas for ending active push:

  1. (easy) timeout after no more data is being transferred
  2. wait until no more want requests

Conversation in IRC:

<•jhand> mafintosh: been awhile since I went through it. But wouldn't the sparse peers only take some of the new changes?
4:20 PM Like if someone is browsing a dat website, they may download one new page but not all of them
4:21 PM <•mafintosh> Mathias Buus jhand: ah i understand what you are saying now
4:21 PM <•jhand> Joe Hand I think the last idea I had was to wait until there are no more want requests
4:21 PM <•mafintosh> Mathias Buus Timing out if prob fine
4:21 PM Yea!
4:22 PM <•jhand> Joe Hand timing out seems much easier
4:22 PM <•mafintosh> Mathias Buus jhand: we actually have a state object also that indicates if the remote is interested in downloading data
4:22 PM <•jhand> Joe Hand ah cool. ya i wasn't sure where to dig into that
4:22 PM <•mafintosh> Mathias Buus I'd do the timeout version first tho as suggested
4:22 PM That makes a ton of sense
@martinheidegger
Copy link

In darp2 I checked with every client that connects if it the peer's bitfield is equal to the own bitfield to make sure that the whole thing is uploaded:

https://github.com/dotloom/darp2/blob/1f9a4ba4216e5106b0fffae0cd2374175022620a/index.js#L59-L72

@martinheidegger
Copy link

After another very long night on that topic I arrived at following state: https://github.com/dotloom/darp2/blob/3ececfbf76aa3f5f5c913659d69aa48460fd71f6/util/trackUpload.js#L13-L66

@pfrazee
Copy link
Collaborator

pfrazee commented Feb 12, 2019

I added the timeout solution for now: 98522b7

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants