Class PeerManagerImpl
java.lang.Object
com.biglybt.pifimpl.local.peers.PeerManagerImpl
- All Implemented Interfaces:
PeerManager
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprivate classprotected class -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate booleanprivate final DiskManagerPiece[]private Map<Peer, PeerForeignDelegate> protected PEPeerManagerprivate final PEPiece[]private static final Stringprivate static final AtomicLongprivate PeerManagerImpl.pieceFacade[]protected static AEMonitorprotected AEMonitor -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidvoidvoidAdd a new peer, using the default internal Peer implementation (like for peers given in announce reply), using the given address and port.voidvoidvoidprotected voidcreatePeerStats(Peer peer) intprotected intstatic PeerImplgetPeerForPEPeer(PEPeer pe_peer) static PeerManagerImplgetPeerManager(PEPeerManager _manager) Peer[]getPeers()Peer[]returns the peers for the given addressGet the list of currently pending peersgetPendingPeers(String address) returns the pending connections to the given addressPiece[]getStats()longintbooleanbooleanprotected PeerForeignDelegatelookupForeignPeer(Peer _foreign) mapForeignPeer(Peer _foreign) mapForeignPeers(Peer[] _foreigns) voidpeerDiscovered(String peer_source, String ip_address, int tcp_port, int udp_port, boolean use_crypto) protected booleanvoidvoidremovePeer(Peer peer, String reason, int reason_code) voidrequestCancelled(PeerReadRequest request, Peer sender) voidrequestComplete(PeerReadRequest request, PooledByteBuffer data, Peer sender) Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface PeerManager
removePeer
-
Field Details
-
PEPEER_DATA_KEY
-
PEPEER_DATA_KEY_AL
-
manager
-
pm_map_mon
-
foreign_map
-
listener_map2
-
this_mon
-
dm_pieces
-
pe_pieces
-
piece_facades
-
destroyed
private boolean destroyed
-
-
Constructor Details
-
PeerManagerImpl
-
-
Method Details
-
getPeerManager
-
getDelegate
-
getDiskManager
- Specified by:
getDiskManagerin interfacePeerManager
-
getStats
- Specified by:
getStatsin interfacePeerManager
-
isSeeding
public boolean isSeeding()- Specified by:
isSeedingin interfacePeerManager
-
isSuperSeeding
public boolean isSuperSeeding()- Specified by:
isSuperSeedingin interfacePeerManager
-
getDownload
- Specified by:
getDownloadin interfacePeerManager- Throws:
DownloadException
-
getPieces
- Specified by:
getPiecesin interfacePeerManager
-
createPeerStats
- Specified by:
createPeerStatsin interfacePeerManager
-
requestComplete
- Specified by:
requestCompletein interfacePeerManager
-
requestCancelled
- Specified by:
requestCancelledin interfacePeerManager
-
getPartitionID
protected int getPartitionID() -
addPeer
- Specified by:
addPeerin interfacePeerManager
-
removePeer
- Specified by:
removePeerin interfacePeerManager
-
addPeer
Description copied from interface:PeerManagerAdd a new peer, using the default internal Peer implementation (like for peers given in announce reply), using the given address and port.- Specified by:
addPeerin interfacePeerManager- Parameters:
ip_address- of peer to injecttcp_port- of peer to inject
-
addPeer
- Specified by:
addPeerin interfacePeerManager
-
addPeer
- Specified by:
addPeerin interfacePeerManager
-
addPeer
public void addPeer(String ip_address, int tcp_port, int udp_port, boolean use_crypto, Map user_data) - Specified by:
addPeerin interfacePeerManager
-
peerDiscovered
public void peerDiscovered(String peer_source, String ip_address, int tcp_port, int udp_port, boolean use_crypto) - Specified by:
peerDiscoveredin interfacePeerManager
-
pluginPeerSourceEnabled
protected boolean pluginPeerSourceEnabled() -
checkIfPrivate
protected void checkIfPrivate() -
getPeers
- Specified by:
getPeersin interfacePeerManager
-
getPeers
Description copied from interface:PeerManagerreturns the peers for the given address- Specified by:
getPeersin interfacePeerManager- Parameters:
address-- Returns:
-
getPendingPeers
Description copied from interface:PeerManagerGet the list of currently pending peers- Specified by:
getPendingPeersin interfacePeerManager- Returns:
-
getPendingPeers
Description copied from interface:PeerManagerreturns the pending connections to the given address- Specified by:
getPendingPeersin interfacePeerManager- Parameters:
address-- Returns:
-
getTimeSinceConnectionEstablished
-
mapForeignPeer
-
lookupForeignPeer
-
mapForeignPeers
-
getPeerForPEPeer
-
getUploadRateLimitBytesPerSecond
public int getUploadRateLimitBytesPerSecond()- Specified by:
getUploadRateLimitBytesPerSecondin interfacePeerManager
-
getDownloadRateLimitBytesPerSecond
public int getDownloadRateLimitBytesPerSecond()- Specified by:
getDownloadRateLimitBytesPerSecondin interfacePeerManager
-
addListener
- Specified by:
addListenerin interfacePeerManager
-
removeListener
- Specified by:
removeListenerin interfacePeerManager
-