Class SinglePeerUploader
java.lang.Object
com.biglybt.core.networkmanager.impl.SinglePeerUploader
- All Implemented Interfaces:
RateControlledEntity
A fast write 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
ConstructorsConstructorDescriptionSinglePeerUploader
(NetworkConnectionBase connection, RateHandler rate_handler) -
Method Summary
Modifier and TypeMethodDescriptionboolean
canProcess
(EventWaiter waiter) Is ready for a processing op.int
doProcessing
(EventWaiter waiter, int max_bytes) Attempt to do a processing operation.long
int
getConnectionCount
(EventWaiter waiter) If there are no connections then the waiter will be kicked when a connection arrivesint
Get this entity's priority level.boolean
stats functionsint
getReadyConnectionCount
(EventWaiter waiter) The waiter is kicked if the ready condition changes
-
Field Details
-
connection
-
rate_handler
-
-
Constructor Details
-
SinglePeerUploader
-
-
Method Details
-
getRateHandler
- Specified by:
getRateHandler
in interfaceRateControlledEntity
-
canProcess
Description copied from interface:RateControlledEntity
Is ready for a processing op.- Specified by:
canProcess
in interfaceRateControlledEntity
- Returns:
- true if it can process >0 bytes, false if not ready
-
doProcessing
Description copied from interface:RateControlledEntity
Attempt to do a processing operation.- Specified by:
doProcessing
in interfaceRateControlledEntity
- 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.- Specified by:
getPriority
in interfaceRateControlledEntity
- Returns:
- priority
-
getPriorityBoost
public boolean getPriorityBoost()Description copied from interface:RateControlledEntity
stats functions- Specified by:
getPriorityBoost
in interfaceRateControlledEntity
- Returns:
-
getBytesReadyToWrite
public long getBytesReadyToWrite()- Specified by:
getBytesReadyToWrite
in interfaceRateControlledEntity
-
getConnectionCount
Description copied from interface:RateControlledEntity
If there are no connections then the waiter will be kicked when a connection arrives- Specified by:
getConnectionCount
in interfaceRateControlledEntity
- Returns:
-
getReadyConnectionCount
Description copied from interface:RateControlledEntity
The waiter is kicked if the ready condition changes- Specified by:
getReadyConnectionCount
in interfaceRateControlledEntity
- Returns:
-
getString
- Specified by:
getString
in interfaceRateControlledEntity
-