class DHTTracker extends Object
| Constructor and Description |
|---|
DHTTracker(I2PAppContext ctx)Create a tracker for the given context. |
DHTTracker(I2PAppContext ctx,
long filterCacheTime) |
| Modifier and Type | Method and Description |
|---|---|
(package private) void | announce(InfoHash ih,
Hash hash,
boolean isSeed)Announce a peer for a torrent. |
(package private) BloomFilter[] | getBloomFilters(InfoHash ih)Build BEP 33 bloom filters for a torrent, one for the stored seeds
and one for the stored peers, by inserting the 32-byte destination
hash of each peer into the appropriate filter. |
(package private) List<Hash> | getPeers(InfoHash ih,
int max,
boolean noSeeds)Fetch peers for a torrent. |
void | renderStatusHTML(StringBuilder buf)Debug info, HTML formatted. |
void | start() |
(package private) void | stop()Stop the tracker |
(package private) void | unannounce(InfoHash ih,
Hash hash)Remove a peer from a torrent's peer list. |
DHTTracker(I2PAppContext ctx)
ctx - the app contextDHTTracker(I2PAppContext ctx, long filterCacheTime)
ctx - the app contextfilterCacheTime - how long built bloom filters are reused, milliseconds; for testsvoid announce(InfoHash ih, Hash hash, boolean isSeed)
ih - the info hash of the torrenthash - the peer's destination hashisSeed - true if the peer is a seedBloomFilter[] getBloomFilters(InfoHash ih)
ih - the info hash of the torrentList<Hash> getPeers(InfoHash ih, int max, boolean noSeeds)
ih - the info hash of the torrentmax - maximum number of peers to returnnoSeeds - true if we do not want seeds in the resultpublic void renderStatusHTML(StringBuilder buf)
buf - the buffer to append HTML topublic void start()
void stop()