Class MultiPeerDownloader2

java.lang.Object
com.biglybt.core.networkmanager.impl.RateControlledMultipleEntity
com.biglybt.core.networkmanager.impl.MultiPeerDownloader2
All Implemented Interfaces:
ControllerAllocationManagement, RateControlledEntity

public class MultiPeerDownloader2 extends RateControlledMultipleEntity
  • Field Details

  • Constructor Details

    • MultiPeerDownloader2

      public MultiPeerDownloader2(RateHandler _main_handler)
      Create new downloader using the given "global" rate handler to limit all peers managed by this downloader.
      Parameters:
      main_handler -
  • Method Details

    • getRateHandler

      public RateHandler getRateHandler()
    • getPartitionID

      public int getPartitionID()
      Description copied from interface: RateControlledEntity
      Is ready for a processing op.
      Returns:
      true if it can process >0 bytes, false if not ready
    • addPeerConnection

      public void addPeerConnection(NetworkConnectionBase connection)
      Add the given connection to the downloader.
      Parameters:
      connection - to add
    • removePeerConnection

      public boolean removePeerConnection(NetworkConnectionBase connection)
      Remove the given connection from the downloader.
      Parameters:
      connection - to remove
      Returns:
      true if the connection was found and removed, false if not removed
    • canProcess

      public boolean canProcess(EventWaiter waiter)
    • getBytesReadyToWrite

      public long getBytesReadyToWrite()
    • getConnectionCount

      public int getConnectionCount(EventWaiter _waiter)
      Description copied from interface: RateControlledEntity
      If there are no connections then the waiter will be kicked when a connection arrives
      Parameters:
      _waiter -
      Returns:
    • getReadyConnectionCount

      public int getReadyConnectionCount(EventWaiter waiter)
      Description copied from interface: RateControlledEntity
      The waiter is kicked if the ready condition changes
      Parameters:
      waiter -
      Returns:
    • doProcessing

      public long doProcessing(EventWaiter waiter, int max_bytes)
      Description copied from interface: RateControlledEntity
      Attempt to do a processing operation.
      Returns:
      true if >0 bytes were processed (success), false if 0 bytes were processed (failure)
    • getPriority

      public int getPriority()
      Description copied from interface: RateControlledEntity
      Get this entity's priority level.
      Returns:
      priority
    • getPriorityBoost

      public boolean getPriorityBoost()
      Description copied from interface: RateControlledEntity
      stats functions
      Returns:
    • getString

      public String getString()