Giter VIP home page Giter VIP logo

Comments (3)

pvishnyakov avatar pvishnyakov commented on June 7, 2024

Found the problem, customized PieceSelector is wrapped into the PrioritizedPieceSelector and then into ValidatingSelector which is making impossible to control the pieces feed.
Changed PrioritizedPieceSelector back to PieceSelector in all occurrences from Assignment and up, result is more predictable now, I can feed the pieces range by range maintaining the desired sequence order.

It doesn't explain why it worked in desktop Java, however, it's working now.
Please consider update to the Core library.

from bt.

pyckle avatar pyckle commented on June 7, 2024

Hi @pvishnyakov. I believe what you wrote is not a valid piece selector. The interface specifies that the piece selector returns chunks that are relevant. In your selector, it may return chunks that are already downloaded.

I believe what you're trying to do was already implemented in the class https://github.com/atomashpolskiy/bt/blob/master/bt-core/src/main/java/bt/torrent/selector/SequentialSelector.java

Instead of returning all pieces, it only returns the pieces that haven't been downloaded or already allocated.

from bt.

pvishnyakov avatar pvishnyakov commented on June 7, 2024

I want the file to be downloaded range by range, for example [0,1,2,3], then [4,5,6,7], [8,9,10,11] and so on.
So my getNextPieces is always like return IntStream.of(range) where range is the int[] array of pieces to download.

ValidatingSelector is still there to prevent the downloaded pieces from being re-assigned and it's ok to have ValidatingSelector(MySelector) wrapping. But originally we have ValidatingSelector(PrioritizedPieceSelector(MySelector)) wrapping which is making hard to control the sequence.
Without PrioritizedPieceSelector it works as expected now, I don't know why but it does.

from bt.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.