Changeset 348805f0
- Timestamp:
- Dec 1, 2015 8:12:31 PM (5 years ago)
- Branches:
- master
- Children:
- b53fe37
- Parents:
- 72527f4
- Location:
- apps/i2psnark/java/src/org/klomp/snark
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
apps/i2psnark/java/src/org/klomp/snark/I2PSnarkUtil.java
r72527f4 r348805f0 76 76 public static final int DEFAULT_STARTUP_DELAY = 3; 77 77 public static final boolean DEFAULT_USE_OPENTRACKERS = true; 78 public static final int MAX_CONNECTIONS = 16; // per torrent78 public static final int MAX_CONNECTIONS = 24; // per torrent 79 79 public static final String PROP_MAX_BW = "i2cp.outboundBytesPerSecond"; 80 80 public static final boolean DEFAULT_USE_DHT = true; -
apps/i2psnark/java/src/org/klomp/snark/IdleChecker.java
r72527f4 r348805f0 121 121 String i = opts.get("inbound.quantity"); 122 122 if (i == null) 123 i = "3";123 i = Integer.toString(SnarkManager.DEFAULT_TUNNEL_QUANTITY); 124 124 String o = opts.get("outbound.quantity"); 125 125 if (o == null) 126 o = "3";126 o = Integer.toString(SnarkManager.DEFAULT_TUNNEL_QUANTITY); 127 127 String ib = opts.get("inbound.backupQuantity"); 128 128 if (ib == null) -
apps/i2psnark/java/src/org/klomp/snark/PeerCoordinator.java
r72527f4 r348805f0 71 71 // package local for access by CheckDownLoadersTask 72 72 final static long CHECK_PERIOD = 40*1000; // 40 seconds 73 final static int MAX_UPLOADERS = 6;73 final static int MAX_UPLOADERS = 8; 74 74 public static final long MAX_INACTIVE = 8*60*1000; 75 75 … … 404 404 * reduce max if huge pieces to keep from ooming when leeching 405 405 * but now we don't 406 * @return usually 16406 * @return usually I2PSnarkUtil.MAX_CONNECTIONS 407 407 */ 408 408 private int getMaxConnections() { -
apps/i2psnark/java/src/org/klomp/snark/Snark.java
r72527f4 r348805f0 1330 1330 */ 1331 1331 final static int MIN_TOTAL_UPLOADERS = 4; 1332 final static int MAX_TOTAL_UPLOADERS = 10;1332 final static int MAX_TOTAL_UPLOADERS = 20; 1333 1333 1334 1334 public boolean overUploadLimit(int uploaders) { -
apps/i2psnark/java/src/org/klomp/snark/SnarkManager.java
r72527f4 r348805f0 134 134 public static final int DEFAULT_REFRESH_DELAY_SECS = 60; 135 135 private static final int DEFAULT_PAGE_SIZE = 50; 136 public static final int DEFAULT_TUNNEL_QUANTITY = 3; 136 137 public static final String CONFIG_DIR_SUFFIX = ".d"; 137 138 private static final String SUBDIR_PREFIX = "s"; … … 611 612 _config.setProperty(PROP_I2CP_PORT, "7654"); 612 613 if (!_config.containsKey(PROP_I2CP_OPTS)) 613 _config.setProperty(PROP_I2CP_OPTS, "inbound.length=3 outbound.length=3 inbound.quantity=3 outbound.quantity=3"); 614 _config.setProperty(PROP_I2CP_OPTS, "inbound.length=3 outbound.length=3" + 615 " inbound.quantity=" + DEFAULT_TUNNEL_QUANTITY + 616 " outbound.quantity=" + DEFAULT_TUNNEL_QUANTITY); 614 617 //if (!_config.containsKey(PROP_EEP_HOST)) 615 618 // _config.setProperty(PROP_EEP_HOST, "127.0.0.1"); -
apps/i2psnark/java/src/org/klomp/snark/dht/KRPC.java
r72527f4 r348805f0 41 41 import net.i2p.util.SimpleTimer2; 42 42 43 import org.klomp.snark.I2PSnarkUtil; 43 44 import org.klomp.snark.SnarkManager; 44 45 import org.klomp.snark.TrackerClient; … … 129 130 /** Max number of nodes to return. BEP 5 says 8 */ 130 131 private static final int K = 8; 131 /** Max number of peers to return. BEP 5 doesn't say. We'll use the same as I2PSnarkUtil.MAX_CONNECTIONS */ 132 private static final int MAX_WANT = 16; 132 /** Max number of peers to return. BEP 5 doesn't say. 133 * We'll use more than I2PSnarkUtil.MAX_CONNECTIONS since lots could be old. 134 */ 135 private static final int MAX_WANT = I2PSnarkUtil.MAX_CONNECTIONS * 3 / 2; 133 136 134 137 /** overloads error codes which start with 201 */ … … 1413 1416 if (_log.shouldLog(Log.INFO)) 1414 1417 _log.info("Rcvd peers from: " + nInfo); 1415 int max = Math.min(MAX_WANT , peers.size());1418 int max = Math.min(MAX_WANT * 2, peers.size()); 1416 1419 List<Hash> rv = new ArrayList<Hash>(max); 1417 1420 for (BEValue bev : peers) { -
apps/i2psnark/java/src/org/klomp/snark/web/I2PSnarkServlet.java
r72527f4 r348805f0 2306 2306 out.write(_t("Inbound Settings")); 2307 2307 out.write(":<td>"); 2308 out.write(renderOptions(1, 10, 3, options.remove("inbound.quantity"), "inbound.quantity", TUNNEL)); 2308 out.write(renderOptions(1, 10, SnarkManager.DEFAULT_TUNNEL_QUANTITY, 2309 options.remove("inbound.quantity"), "inbound.quantity", TUNNEL)); 2309 2310 out.write(" "); 2310 2311 out.write(renderOptions(0, 4, 3, options.remove("inbound.length"), "inbound.length", HOP)); … … 2312 2313 out.write(_t("Outbound Settings")); 2313 2314 out.write(":<td>"); 2314 out.write(renderOptions(1, 10, 3, options.remove("outbound.quantity"), "outbound.quantity", TUNNEL)); 2315 out.write(renderOptions(1, 10, SnarkManager.DEFAULT_TUNNEL_QUANTITY, 2316 options.remove("outbound.quantity"), "outbound.quantity", TUNNEL)); 2315 2317 out.write(" "); 2316 2318 out.write(renderOptions(0, 4, 3, options.remove("outbound.length"), "outbound.length", HOP));
Note: See TracChangeset
for help on using the changeset viewer.