forked from I2P_Developers/i2p.i2p
set up transport cost constants
This commit is contained in:
@@ -234,7 +234,7 @@ public class CommSystemFacadeImpl extends CommSystemFacade {
|
||||
props.setProperty(NTCPAddress.PROP_HOST, name);
|
||||
props.setProperty(NTCPAddress.PROP_PORT, port);
|
||||
RouterAddress addr = new RouterAddress();
|
||||
addr.setCost(10);
|
||||
addr.setCost(NTCPAddress.DEFAULT_COST);
|
||||
addr.setExpiration(null);
|
||||
addr.setOptions(props);
|
||||
addr.setTransportStyle(NTCPTransport.STYLE);
|
||||
@@ -268,7 +268,7 @@ public class CommSystemFacadeImpl extends CommSystemFacade {
|
||||
RouterAddress newAddr = oldAddr;
|
||||
if (newAddr == null) {
|
||||
newAddr = new RouterAddress();
|
||||
newAddr.setCost(10);
|
||||
newAddr.setCost(NTCPAddress.DEFAULT_COST);
|
||||
newAddr.setExpiration(null);
|
||||
newAddr.setTransportStyle(NTCPTransport.STYLE);
|
||||
newProps = new Properties();
|
||||
|
@@ -28,6 +28,7 @@ public class NTCPAddress {
|
||||
public final static String PROP_PORT = "port";
|
||||
/** Host name used in RouterAddress definitions */
|
||||
public final static String PROP_HOST = "host";
|
||||
public static final int DEFAULT_COST = 10;
|
||||
|
||||
public NTCPAddress(String host, int port) {
|
||||
if (host != null)
|
||||
@@ -82,7 +83,7 @@ public class NTCPAddress {
|
||||
|
||||
RouterAddress addr = new RouterAddress();
|
||||
|
||||
addr.setCost(10);
|
||||
addr.setCost(DEFAULT_COST);
|
||||
addr.setExpiration(null);
|
||||
|
||||
Properties props = new Properties();
|
||||
|
@@ -154,6 +154,7 @@ public class UDPTransport extends TransportImpl implements TimedWeightedPriority
|
||||
|
||||
private static final int MAX_CONSECUTIVE_FAILED = 5;
|
||||
|
||||
public static final int DEFAULT_COST = 5;
|
||||
private static final int TEST_FREQUENCY = 13*60*1000;
|
||||
public static final long[] RATES = { 10*60*1000 };
|
||||
|
||||
@@ -1213,7 +1214,7 @@ public class UDPTransport extends TransportImpl implements TimedWeightedPriority
|
||||
options.setProperty(UDPAddress.PROP_INTRO_KEY, _introKey.toBase64());
|
||||
|
||||
RouterAddress addr = new RouterAddress();
|
||||
addr.setCost(5);
|
||||
addr.setCost(DEFAULT_COST);
|
||||
addr.setExpiration(null);
|
||||
addr.setTransportStyle(STYLE);
|
||||
addr.setOptions(options);
|
||||
|
Reference in New Issue
Block a user