Class TransferProcessor
java.lang.Object
com.biglybt.core.networkmanager.impl.TransferProcessor
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprivate static classprivate static class -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final HashMap<NetworkConnectionBase, TransferProcessor.ConnectionData> (package private) final AEMonitorprivate final HashMap<LimitedRateGroup, TransferProcessor.GroupData> (package private) final ByteBucketprivate final EntityHandlerprivate final RateHandler(package private) final LimitedRateGroupprivate final boolean(package private) final int(package private) static booleanprivate static final boolean(package private) static booleanstatic final intstatic final int -
Constructor Summary
ConstructorsConstructorDescriptionTransferProcessor(NetworkManager net_man, int _processor_type, LimitedRateGroup max_rate_limit, boolean multi_threaded) Create new transfer processor for the given read/write type, limited to the given max rate. -
Method Summary
Modifier and TypeMethodDescriptionvoidaddRateLimiter(NetworkConnectionBase connection, LimitedRateGroup group) private ByteBucketcreateBucket(long bytes_per_sec) booleanderegisterPeerConnection(NetworkConnectionBase connection, int partition_id) Cancel upload handling for the given peer connection.voiddowngradePeerConnection(NetworkConnectionBase connection, int partition_id) Downgrade the given connection back to a normal-speed transfer handler.getRateHandler(NetworkConnectionBase connection) booleanisRegistered(NetworkConnectionBase connection) voidregisterPeerConnection(NetworkConnectionBase connection, boolean upload) Register peer connection for upload handling.voidremoveRateLimiter(NetworkConnectionBase connection, LimitedRateGroup group) voidsetRateLimiterFreezeState(boolean frozen) voidupgradePeerConnection(NetworkConnectionBase connection, int partition_id) Upgrade the given connection to a high-speed transfer handler.
-
Field Details
-
RATE_LIMIT_LAN_TOO
private static final boolean RATE_LIMIT_LAN_TOO- See Also:
-
RATE_LIMIT_UP_INCLUDES_PROTOCOL
static boolean RATE_LIMIT_UP_INCLUDES_PROTOCOL -
RATE_LIMIT_DOWN_INCLUDES_PROTOCOL
static boolean RATE_LIMIT_DOWN_INCLUDES_PROTOCOL -
TYPE_UPLOAD
public static final int TYPE_UPLOAD- See Also:
-
TYPE_DOWNLOAD
public static final int TYPE_DOWNLOAD- See Also:
-
processor_type
final int processor_type -
max_rate
-
main_rate_handler
-
main_bucket
-
main_controller
-
group_buckets
-
connections
-
connections_mon
-
multi_threaded
private final boolean multi_threaded
-
-
Constructor Details
-
TransferProcessor
public TransferProcessor(NetworkManager net_man, int _processor_type, LimitedRateGroup max_rate_limit, boolean multi_threaded) Create new transfer processor for the given read/write type, limited to the given max rate.- Parameters:
max_rate_limit- to useprocessor_type- read or write processor
-
-
Method Details
-
registerPeerConnection
Register peer connection for upload handling. NOTE: The given max rate limit is ignored until the connection is upgraded.- Parameters:
connection- to registergroup- rate limit group
-
getConnections
-
isRegistered
-
deregisterPeerConnection
Cancel upload handling for the given peer connection.- Parameters:
connection- to cancel
-
setRateLimiterFreezeState
public void setRateLimiterFreezeState(boolean frozen) -
addRateLimiter
-
removeRateLimiter
-
upgradePeerConnection
Upgrade the given connection to a high-speed transfer handler.- Parameters:
connection- to upgrade
-
downgradePeerConnection
Downgrade the given connection back to a normal-speed transfer handler.- Parameters:
connection- to downgrade
-
getRateHandler
-
getRateHandler
-
createBucket
-