Class SinglePeerDownloader
java.lang.Object
com.biglybt.core.networkmanager.impl.SinglePeerDownloader
- All Implemented Interfaces:
RateControlledEntity
A fast read entity backed by a single peer connection.
-
Field Summary
FieldsFields inherited from interface com.biglybt.core.networkmanager.impl.RateControlledEntity
PRIORITY_HIGH, PRIORITY_NORMAL -
Constructor Summary
ConstructorsConstructorDescriptionSinglePeerDownloader(NetworkConnectionBase connection, RateHandler rate_handler) -
Method Summary
Modifier and TypeMethodDescriptionbooleancanProcess(EventWaiter waiter) Is ready for a processing op.intdoProcessing(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 arrivesintGet 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
- Specified by:
getRateHandlerin interfaceRateControlledEntity
-
canProcess
Description copied from interface:RateControlledEntityIs ready for a processing op.- Specified by:
canProcessin interfaceRateControlledEntity- Returns:
- true if it can process >0 bytes, false if not ready
-
doProcessing
Description copied from interface:RateControlledEntityAttempt to do a processing operation.- Specified by:
doProcessingin interfaceRateControlledEntity- 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.- Specified by:
getPriorityin interfaceRateControlledEntity- Returns:
- priority
-
getPriorityBoost
public boolean getPriorityBoost()Description copied from interface:RateControlledEntitystats functions- Specified by:
getPriorityBoostin interfaceRateControlledEntity- Returns:
-
getBytesReadyToWrite
public long getBytesReadyToWrite()- Specified by:
getBytesReadyToWritein interfaceRateControlledEntity
-
getConnectionCount
Description copied from interface:RateControlledEntityIf there are no connections then the waiter will be kicked when a connection arrives- Specified by:
getConnectionCountin interfaceRateControlledEntity- Returns:
-
getReadyConnectionCount
Description copied from interface:RateControlledEntityThe waiter is kicked if the ready condition changes- Specified by:
getReadyConnectionCountin interfaceRateControlledEntity- Returns:
-
getString
- Specified by:
getStringin interfaceRateControlledEntity
-