org.klomp.snark
Class TrackerClient
java.lang.Object
java.lang.Thread
net.i2p.util.I2PThread
net.i2p.util.I2PAppThread
org.klomp.snark.TrackerClient
- All Implemented Interfaces:
- Runnable
public class TrackerClient
- extends I2PAppThread
Informs metainfo tracker of events and gets new peers for peer
coordinator.
- Author:
- Mark Wielaard (mark@klomp.org)
Methods inherited from class java.lang.Thread |
activeCount, checkAccess, clone, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, stop, stop, suspend, toString, yield |
TrackerClient
public TrackerClient(I2PSnarkUtil util,
MetaInfo meta,
String additionalTrackerURL,
PeerCoordinator coordinator,
Snark snark)
- Parameters:
meta
- null if in magnet modeadditionalTrackerURL
- may be null, from the ?tr= param in magnet mode, otherwise ignored
start
public void start()
- Overrides:
start
in class Thread
halted
public boolean halted()
started
public boolean started()
halt
public void halt()
- Interrupts this Thread to stop it.
run
public void run()
- Specified by:
run
in interface Runnable
- Overrides:
run
in class I2PThread
urlencode
public static String urlencode(byte[] bs)
- Very lazy byte[] to URL encoder. Just encodes almost everything, even
some "normal" chars.
By not encoding about 1/4 of the chars, we make random data like hashes about 16% smaller.
RFC1738: 0-9a-zA-Z$-_.+!*'(),
Us: 0-9a-zA-Z
isValidAnnounce
static boolean isValidAnnounce(String ann)
- Returns:
- true for i2p hosts only
- Since:
- 0.7.12