Class TransferProcessor
java.lang.Object
com.biglybt.core.networkmanager.impl.TransferProcessor
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprivate static class
private static class
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final HashMap<NetworkConnectionBase,
TransferProcessor.ConnectionData> (package private) final AEMonitor
private final HashMap<LimitedRateGroup,
TransferProcessor.GroupData> (package private) final ByteBucket
private final EntityHandler
private final RateHandler
(package private) final LimitedRateGroup
private final boolean
(package private) final int
(package private) static boolean
private static final boolean
(package private) static boolean
static final int
static 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 TypeMethodDescriptionvoid
addRateLimiter
(NetworkConnectionBase connection, LimitedRateGroup group) private ByteBucket
createBucket
(int bytes_per_sec) boolean
deregisterPeerConnection
(NetworkConnectionBase connection) Cancel upload handling for the given peer connection.void
downgradePeerConnection
(NetworkConnectionBase connection) Downgrade the given connection back to a normal-speed transfer handler.getRateHandler
(NetworkConnectionBase connection) boolean
isRegistered
(NetworkConnectionBase connection) void
registerPeerConnection
(NetworkConnectionBase connection, boolean upload) Register peer connection for upload handling.void
removeRateLimiter
(NetworkConnectionBase connection, LimitedRateGroup group) void
setRateLimiterFreezeState
(boolean frozen) void
upgradePeerConnection
(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:
processor_type
- read or write processormax_rate_limit
- to use
-
-
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
-