Class SinglePeerDownloader
java.lang.Object
com.biglybt.core.networkmanager.impl.RateControlledSingleEntity
com.biglybt.core.networkmanager.impl.SinglePeerDownloader
- All Implemented Interfaces:
ControllerAllocationManagement, RateControlledEntity
A fast read entity backed by a single peer connection.
-
Field Summary
FieldsFields inherited from interface ControllerAllocationManagement
UNALLOCATED_PARTITIONFields inherited from interface RateControlledEntity
PRIORITY_HIGH, PRIORITY_NORMAL -
Constructor Summary
ConstructorsConstructorDescriptionSinglePeerDownloader(NetworkConnectionBase connection, RateHandler rate_handler) -
Method Summary
Modifier and TypeMethodDescriptionbooleancanProcess(EventWaiter waiter) longdoProcessing(EventWaiter waiter, int max_bytes) Attempt to do a processing operation.longintgetConnectionCount(EventWaiter waiter) If there are no connections then the waiter will be kicked when a connection arrivesintIs ready for a processing op.intGet this entity's priority level.booleanstats functionsintgetReadyConnectionCount(EventWaiter waiter) The waiter is kicked if the ready condition changes
-
Field Details
-
connection
-
rate_handler
-
-
Constructor Details
-
SinglePeerDownloader
-
-
Method Details
-
getRateHandler
-
getPartitionID
public int getPartitionID()Description copied from interface:RateControlledEntityIs ready for a processing op.- Returns:
- true if it can process >0 bytes, false if not ready
-
canProcess
-
doProcessing
Description copied from interface:RateControlledEntityAttempt 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:RateControlledEntityGet this entity's priority level.- Returns:
- priority
-
getPriorityBoost
public boolean getPriorityBoost()Description copied from interface:RateControlledEntitystats functions- Returns:
-
getBytesReadyToWrite
public long getBytesReadyToWrite() -
getConnectionCount
Description copied from interface:RateControlledEntityIf there are no connections then the waiter will be kicked when a connection arrives- Parameters:
waiter-- Returns:
-
getReadyConnectionCount
Description copied from interface:RateControlledEntityThe waiter is kicked if the ready condition changes- Parameters:
waiter-- Returns:
-
getString
-