Package com.biglybt.pifimpl.local.peers
Class PeerManagerImpl
java.lang.Object
com.biglybt.pifimpl.local.peers.PeerManagerImpl
- All Implemented Interfaces:
PeerManager
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprivate class
protected class
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate boolean
private final DiskManagerPiece[]
private Map
<Peer, PeerForeignDelegate> protected PEPeerManager
private final PEPiece[]
private static final String
private static final AtomicLong
private PeerManagerImpl.pieceFacade[]
protected static AEMonitor
protected AEMonitor
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
void
void
Add a new peer, using the default internal Peer implementation (like for peers given in announce reply), using the given address and port.void
void
void
protected void
createPeerStats
(Peer peer) int
protected int
static PeerImpl
getPeerForPEPeer
(PEPeer pe_peer) static PeerManagerImpl
getPeerManager
(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()
long
int
boolean
boolean
protected PeerForeignDelegate
lookupForeignPeer
(Peer _foreign) mapForeignPeer
(Peer _foreign) mapForeignPeers
(Peer[] _foreigns) void
peerDiscovered
(String peer_source, String ip_address, int tcp_port, int udp_port, boolean use_crypto) protected boolean
void
void
removePeer
(Peer peer, String reason, int reason_code) void
requestCancelled
(PeerReadRequest request, Peer sender) void
requestComplete
(PeerReadRequest request, PooledByteBuffer data, Peer sender) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.biglybt.pif.peers.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:
getDiskManager
in interfacePeerManager
-
getStats
- Specified by:
getStats
in interfacePeerManager
-
isSeeding
public boolean isSeeding()- Specified by:
isSeeding
in interfacePeerManager
-
isSuperSeeding
public boolean isSuperSeeding()- Specified by:
isSuperSeeding
in interfacePeerManager
-
getDownload
- Specified by:
getDownload
in interfacePeerManager
- Throws:
DownloadException
-
getPieces
- Specified by:
getPieces
in interfacePeerManager
-
createPeerStats
- Specified by:
createPeerStats
in interfacePeerManager
-
requestComplete
- Specified by:
requestComplete
in interfacePeerManager
-
requestCancelled
- Specified by:
requestCancelled
in interfacePeerManager
-
getPartitionID
protected int getPartitionID() -
addPeer
- Specified by:
addPeer
in interfacePeerManager
-
removePeer
- Specified by:
removePeer
in interfacePeerManager
-
addPeer
Description copied from interface:PeerManager
Add a new peer, using the default internal Peer implementation (like for peers given in announce reply), using the given address and port.- Specified by:
addPeer
in interfacePeerManager
- Parameters:
ip_address
- of peer to injecttcp_port
- of peer to inject
-
addPeer
- Specified by:
addPeer
in interfacePeerManager
-
addPeer
- Specified by:
addPeer
in interfacePeerManager
-
addPeer
public void addPeer(String ip_address, int tcp_port, int udp_port, boolean use_crypto, Map user_data) - Specified by:
addPeer
in interfacePeerManager
-
peerDiscovered
public void peerDiscovered(String peer_source, String ip_address, int tcp_port, int udp_port, boolean use_crypto) - Specified by:
peerDiscovered
in interfacePeerManager
-
pluginPeerSourceEnabled
protected boolean pluginPeerSourceEnabled() -
checkIfPrivate
protected void checkIfPrivate() -
getPeers
- Specified by:
getPeers
in interfacePeerManager
-
getPeers
Description copied from interface:PeerManager
returns the peers for the given address- Specified by:
getPeers
in interfacePeerManager
- Parameters:
address
-- Returns:
-
getPendingPeers
Description copied from interface:PeerManager
Get the list of currently pending peers- Specified by:
getPendingPeers
in interfacePeerManager
- Returns:
-
getPendingPeers
Description copied from interface:PeerManager
returns the pending connections to the given address- Specified by:
getPendingPeers
in interfacePeerManager
- Parameters:
address
-- Returns:
-
getTimeSinceConnectionEstablished
-
mapForeignPeer
-
lookupForeignPeer
-
mapForeignPeers
-
getPeerForPEPeer
-
getUploadRateLimitBytesPerSecond
public int getUploadRateLimitBytesPerSecond()- Specified by:
getUploadRateLimitBytesPerSecond
in interfacePeerManager
-
getDownloadRateLimitBytesPerSecond
public int getDownloadRateLimitBytesPerSecond()- Specified by:
getDownloadRateLimitBytesPerSecond
in interfacePeerManager
-
addListener
- Specified by:
addListener
in interfacePeerManager
-
removeListener
- Specified by:
removeListener
in interfacePeerManager
-