public class PeerConnectorPool extends Object implements IPeerConnector
| Constructor and Description |
|---|
PeerConnectorPool(TorrentClient torrentClient,
int maxConcurrentConnecting)
Creates a new pool of
PeerConnectors. |
| Modifier and Type | Method and Description |
|---|---|
void |
enqueuePeer(PeerConnectInfo peer)
Queues a peer to be connected
|
int |
getConnectingCount()
Gets the amount of peers are pending to be connected.
|
int |
getConnectingCountFor(Torrent torrent)
Calculates how many connections are assigned to the torrent but haven't passed the BitTorrent handshake yet.
|
void |
start()
Starts the peer connector
|
void |
stop()
Stops the peer connector.
|
public PeerConnectorPool(TorrentClient torrentClient, int maxConcurrentConnecting)
PeerConnectors.torrentClient - The torrent client for which the peers will be connecoted.maxConcurrentConnecting - The amount of concurrent connecting peers.public void start()
start in interface IPeerConnectorpublic void stop()
stop in interface IPeerConnectorpublic void enqueuePeer(PeerConnectInfo peer)
enqueuePeer in interface IPeerConnectorpeer - the peer to be connectedpublic int getConnectingCount()
getConnectingCount in interface IPeerConnectorpublic int getConnectingCountFor(Torrent torrent)
getConnectingCountFor in interface IPeerConnectortorrent - The torrent for which connections must be counted.Copyright © 2016. All rights reserved.