public class PeerConnectionPool extends Object implements IPeerConnectionPool
Note that this class implements a service. Hence, is not a part of the public API and is a subject to change.
Constructor and Description |
---|
PeerConnectionPool(EventSink eventSink,
IRuntimeLifecycleBinder lifecycleBinder,
Config config) |
Modifier and Type | Method and Description |
---|---|
PeerConnection |
addConnectionIfAbsent(PeerConnection newConnection) |
void |
checkDuplicateConnections(TorrentId torrentId,
Peer peer) |
PeerConnection |
getConnection(ConnectionKey key) |
PeerConnection |
getConnection(Peer peer,
TorrentId torrentId) |
int |
size() |
void |
visitConnections(TorrentId torrentId,
Consumer<PeerConnection> visitor)
Visit connections for a given torrent ID.
|
@Inject public PeerConnectionPool(EventSink eventSink, IRuntimeLifecycleBinder lifecycleBinder, Config config)
public PeerConnection getConnection(Peer peer, TorrentId torrentId)
getConnection
in interface IPeerConnectionPool
public PeerConnection getConnection(ConnectionKey key)
getConnection
in interface IPeerConnectionPool
public void visitConnections(TorrentId torrentId, Consumer<PeerConnection> visitor)
IPeerConnectionPool
visitConnections
in interface IPeerConnectionPool
public int size()
size
in interface IPeerConnectionPool
public PeerConnection addConnectionIfAbsent(PeerConnection newConnection)
addConnectionIfAbsent
in interface IPeerConnectionPool
public void checkDuplicateConnections(TorrentId torrentId, Peer peer)
checkDuplicateConnections
in interface IPeerConnectionPool
Copyright © 2016–2021. All rights reserved.