Class EntityHandler
java.lang.Object
com.biglybt.core.networkmanager.impl.EntityHandler
Manages transfer entities on behalf of peer connections.
Each entity handler has a global pool which manages all
connections by default. Connections can also be "upgraded"
to a higher connection control level, i.e. each connection
has its own specialized entity for performance purposes.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final MultiPeerDownloader2private booleanprivate final MultiPeerUploaderprivate final intprivate final AEMonitorprivate final NetworkManagerprivate final HashMap -
Constructor Summary
ConstructorsConstructorDescriptionEntityHandler(NetworkManager _net_man, int type, RateHandler rate_handler) Create a new entity handler using the given rate handler. -
Method Summary
Modifier and TypeMethodDescriptionbooleancancelPeerConnection(NetworkConnectionBase connection, int partition_id) Remove a peer connection from the entity handler.voiddowngradePeerConnection(NetworkConnectionBase connection, int partition_id) Downgrade (return) a peer connection back into the general pool.getRateHandler(NetworkConnectionBase connection) voidregisterPeerConnection(NetworkConnectionBase connection) Register a peer connection for management by the handler.voidupgradePeerConnection(NetworkConnectionBase connection, RateHandler handler, int partition_id) Upgrade a peer connection from the general pool to its own high-speed entity.
-
Field Details
-
upgraded_connections
-
lock
-
global_uploader
-
global_downloader
-
global_registered
private boolean global_registered -
handler_type
private final int handler_type -
net_man
-
-
Constructor Details
-
EntityHandler
Create a new entity handler using the given rate handler.- Parameters:
type- read or write type handlerrate_handler- global max rate handler
-
-
Method Details
-
registerPeerConnection
Register a peer connection for management by the handler.- Parameters:
connection- to add to the global pool
-
cancelPeerConnection
Remove a peer connection from the entity handler.- Parameters:
connection- to cancel
-
upgradePeerConnection
public void upgradePeerConnection(NetworkConnectionBase connection, RateHandler handler, int partition_id) Upgrade a peer connection from the general pool to its own high-speed entity.- Parameters:
connection- to upgrade from global managementhandler- individual connection rate handler
-
downgradePeerConnection
Downgrade (return) a peer connection back into the general pool.- Parameters:
connection- to downgrade back into the global entity
-
getRateHandler
-