public class EqualDistributor extends Object implements IPeerDistributor
IPeerDistributor which attempts to equally distribute the peers.
Note that this implementation does not considered the given limit to be hard limit.
If the limit was reached and another torrent would get added this implementation will allow more peers to connect.
Also when the calculated limit is smaller than 1, the limit will be increased to 1.| Constructor and Description |
|---|
EqualDistributor(TorrentClient torrentClient,
int globalLimit)
Creates a distributor which attempts to equally distribute the peers over the torrents.
|
public EqualDistributor(TorrentClient torrentClient, int globalLimit)
torrentClient - The torrent client for which this distributor is working.globalLimit - The soft limit on the amount of connections.public boolean hasReachedPeerLimit(Torrent torrent)
hasReachedPeerLimit in interface IPeerDistributortorrent - The torrent to calculate the limit for.true when the torrent has reached the calculated peer count limit.Copyright © 2016. All rights reserved.