|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.klomp.snark.TrackerClient
public class TrackerClient
Informs metainfo tracker of events and gets new peers for peer coordinator. start() creates a thread and starts it. At the end of each run, a TimedEvent is queued on the SimpleTimer2 queue. The TimedEvent creates a new thread and starts it, so it does not clog SimpleTimer2. The thread runs one pass through the trackers, the PEX, and the DHT, then queues a new TimedEvent and exits. Thus there are only threads that are actively announcing, not one thread per torrent forever. start() may be called again after halt().
Field Summary | |
---|---|
static int |
PORT
|
Constructor Summary | |
---|---|
TrackerClient(I2PSnarkUtil util,
MetaInfo meta,
String additionalTrackerURL,
PeerCoordinator coordinator,
Snark snark)
Call start() to start it. |
Method Summary | |
---|---|
void |
halt(boolean fast)
Interrupts this Thread to stop it. |
boolean |
halted()
|
static boolean |
isValidAnnounce(String ann)
|
void |
run()
Setup the first time only, then one pass (usually) through the trackers, PEX, and DHT. |
void |
start()
|
boolean |
started()
|
static String |
urlencode(byte[] bs)
Very lazy byte[] to URL encoder. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int PORT
Constructor Detail |
---|
public TrackerClient(I2PSnarkUtil util, MetaInfo meta, String additionalTrackerURL, PeerCoordinator coordinator, Snark snark)
meta
- null if in magnet modeadditionalTrackerURL
- may be null, from the ?tr= param in magnet mode, otherwise ignoredMethod Detail |
---|
public void start()
public boolean halted()
public boolean started()
public void halt(boolean fast)
fast
- if true, limit the life of the unannounce threadspublic void run()
run
in interface Runnable
public static String urlencode(byte[] bs)
public static boolean isValidAnnounce(String ann)
ann
- an announce URL
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |