diff --git a/apps/i2psnark/java/src/org/klomp/snark/TrackerClient.java b/apps/i2psnark/java/src/org/klomp/snark/TrackerClient.java index 9a84c8d3ac64e59fdbc0523dd5bb5858fe33ae20..7f40f483b286000f8b6e6e0fa97a5c70b704e820 100644 --- a/apps/i2psnark/java/src/org/klomp/snark/TrackerClient.java +++ b/apps/i2psnark/java/src/org/klomp/snark/TrackerClient.java @@ -82,7 +82,9 @@ public class TrackerClient implements Runnable { private final static int MAX_CONSEC_FAILS = 5; // slow down after this private final static int LONG_SLEEP = 30*60*1000; // sleep a while after lots of fails private final static long MIN_TRACKER_ANNOUNCE_INTERVAL = 15*60*1000; - private final static long MIN_DHT_ANNOUNCE_INTERVAL = 10*60*1000; + private final static long MIN_DHT_ANNOUNCE_INTERVAL = 39*60*1000; + /** No guidance in BEP 5; standard practice is K (=8) */ + private static final int DHT_ANNOUNCE_PEERS = 4; public static final int PORT = 6881; private static final int MAX_TRACKERS = 12; @@ -651,7 +653,7 @@ public class TrackerClient implements Runnable { else numwant = _util.getMaxConnections(); Collection<Hash> hashes = dht.getPeersAndAnnounce(snark.getInfoHash(), numwant, - 5*60*1000, 1, 3*60*1000, + 5*60*1000, DHT_ANNOUNCE_PEERS, 3*60*1000, coordinator.completed()); if (!hashes.isEmpty()) { runStarted = true; diff --git a/apps/i2psnark/java/src/org/klomp/snark/dht/DHTTracker.java b/apps/i2psnark/java/src/org/klomp/snark/dht/DHTTracker.java index 59706c5f8808fe035eb1adce0c4e2da3ff913e63..64ea84c3ac52b22457fe57b302003cb80341ab0f 100644 --- a/apps/i2psnark/java/src/org/klomp/snark/dht/DHTTracker.java +++ b/apps/i2psnark/java/src/org/klomp/snark/dht/DHTTracker.java @@ -34,7 +34,8 @@ class DHTTracker { /** stagger with other cleaners */ private static final long CLEAN_TIME = 199*1000; - private static final long MAX_EXPIRE_TIME = 45*60*1000; + /** no guidance in BEP 5; Vuze is 8h */ + private static final long MAX_EXPIRE_TIME = 3*60*60*1000L; private static final long MIN_EXPIRE_TIME = 15*60*1000; private static final long DELTA_EXPIRE_TIME = 3*60*1000; private static final int MAX_PEERS = 2000;