public class TorrentDest extends Object
| Modifier and Type | Field and Description |
|---|---|
static String | PROP_POOL_MEMBERSSession property carrying the pool's torrent names, for the /tunnels pool tooltip |
| Constructor and Description |
|---|
TorrentDest(I2PAppContext ctx,
String key,
int poolIndex,
int poolNum,
I2PSocketManager mgr,
I2PServerSocket serverSocket)Assign a torrent to this destination. |
| Modifier and Type | Method and Description |
|---|---|
void | assign(String key,
InfoHash ih,
String name)Assign a torrent to this destination, serving its infohash on the DHT instance when
one already runs, and updating the pool tooltip and tunnel nickname. |
void | destroy()Stop the DHT instance and UDP tracker client and destroy the destination. |
TorrentKRPC | getDHT(KRPC shared)Lazily create the DHT instance on this destination's session, sharing the main
instance's routing table, tracker, and blacklist, serving tracker queries only for
the torrents assigned here. |
String | getKey()The Base64-encoded info hash of the first torrent assigned. |
Destination | getMyDestination()The destination, or null. |
int | getPoolIndex()The shared pool index, or -1 when dedicated to a single torrent. |
int | getPoolNum()The sequential pool number shown in the tunnel nickname "I2PSnark - Pool
<n>", or -1 when dedicated to a single torrent. |
I2PServerSocket | getServerSocket() |
I2PSocketManager | getSocketManager() |
UDPTrackerClient | getUDPTracker(I2PSnarkUtil util)Lazily create the UDP tracker client on this destination's session. |
boolean | unassign(String key)Remove a torrent from this destination, stopping its DHT serving when an instance
runs and updating the pool tooltip and tunnel nickname. |
public static final String PROP_POOL_MEMBERS
public TorrentDest(I2PAppContext ctx, String key, int poolIndex, int poolNum, I2PSocketManager mgr, I2PServerSocket serverSocket)
key - Base64 encoding of the first torrent's info hashpoolIndex - the shared pool index, or -1 for a dedicated destinationpoolNum - the sequential pool number for the nickname, -1 when dedicatedmgr - the socket manager of the new transient destination; must be connectedserverSocket - the destination's server socket, or nullpublic void assign(String key, InfoHash ih, String name)
key - the Base64-encoded info hash keyih - the torrent's info hashname - the torrent name, shown in the pool tooltippublic void destroy()
public TorrentKRPC getDHT(KRPC shared)
shared - the main DHT instance, or null if the DHT is disabledpublic String getKey()
public Destination getMyDestination()
public int getPoolIndex()
public int getPoolNum()
public I2PServerSocket getServerSocket()
public I2PSocketManager getSocketManager()
public UDPTrackerClient getUDPTracker(I2PSnarkUtil util)
util - the shared util, for destination lookupspublic boolean unassign(String key)
key - the Base64-encoded info hash key