forked from I2P_Developers/i2p.i2p
make inbound and exploratory settings final
This commit is contained in:
@ -20,12 +20,8 @@ public class ClientTunnelSettings {
|
||||
private TunnelPoolSettings _outboundSettings;
|
||||
|
||||
public ClientTunnelSettings() {
|
||||
_inboundSettings = new TunnelPoolSettings();
|
||||
_inboundSettings.setIsInbound(true);
|
||||
_inboundSettings.setIsExploratory(false);
|
||||
_outboundSettings = new TunnelPoolSettings();
|
||||
_outboundSettings.setIsInbound(false);
|
||||
_outboundSettings.setIsExploratory(false);
|
||||
_inboundSettings = new TunnelPoolSettings(false, true);
|
||||
_outboundSettings = new TunnelPoolSettings(false, false);
|
||||
}
|
||||
|
||||
public TunnelPoolSettings getInboundSettings() { return _inboundSettings; }
|
||||
|
@ -21,8 +21,8 @@ public class TunnelPoolSettings {
|
||||
private int _length;
|
||||
private int _lengthVariance;
|
||||
private int _lengthOverride;
|
||||
private boolean _isInbound;
|
||||
private boolean _isExploratory;
|
||||
private final boolean _isInbound;
|
||||
private final boolean _isExploratory;
|
||||
private boolean _allowZeroHop;
|
||||
private int _IPRestriction;
|
||||
private final Properties _unknownOptions;
|
||||
@ -54,7 +54,9 @@ public class TunnelPoolSettings {
|
||||
public static final boolean DEFAULT_ALLOW_ZERO_HOP = true;
|
||||
public static final int DEFAULT_IP_RESTRICTION = 2; // class B (/16)
|
||||
|
||||
public TunnelPoolSettings() {
|
||||
public TunnelPoolSettings(boolean isExploratory, boolean isInbound) {
|
||||
_isExploratory = isExploratory;
|
||||
_isInbound = isInbound;
|
||||
_quantity = DEFAULT_QUANTITY;
|
||||
_backupQuantity = DEFAULT_BACKUP_QUANTITY;
|
||||
// _rebuildPeriod = DEFAULT_REBUILD_PERIOD;
|
||||
@ -130,11 +132,9 @@ public class TunnelPoolSettings {
|
||||
|
||||
/** is this an inbound tunnel? */
|
||||
public boolean isInbound() { return _isInbound; }
|
||||
public void setIsInbound(boolean isInbound) { _isInbound = isInbound; }
|
||||
|
||||
/** is this an exploratory tunnel (or a client tunnel) */
|
||||
public boolean isExploratory() { return _isExploratory; }
|
||||
public void setIsExploratory(boolean isExploratory) { _isExploratory = isExploratory; }
|
||||
|
||||
// Duration is hardcoded
|
||||
//public int getDuration() { return _duration; }
|
||||
|
@ -64,13 +64,9 @@ public class TunnelPoolManager implements TunnelManagerFacade {
|
||||
_clientPeerSelector = new ClientPeerSelector(ctx);
|
||||
|
||||
ExploratoryPeerSelector selector = new ExploratoryPeerSelector(_context);
|
||||
TunnelPoolSettings inboundSettings = new TunnelPoolSettings();
|
||||
inboundSettings.setIsExploratory(true);
|
||||
inboundSettings.setIsInbound(true);
|
||||
TunnelPoolSettings inboundSettings = new TunnelPoolSettings(true, true);
|
||||
_inboundExploratory = new TunnelPool(_context, this, inboundSettings, selector);
|
||||
TunnelPoolSettings outboundSettings = new TunnelPoolSettings();
|
||||
outboundSettings.setIsExploratory(true);
|
||||
outboundSettings.setIsInbound(false);
|
||||
TunnelPoolSettings outboundSettings = new TunnelPoolSettings(true, false);
|
||||
_outboundExploratory = new TunnelPool(_context, this, outboundSettings, selector);
|
||||
|
||||
// threads will be started in startup()
|
||||
|
Reference in New Issue
Block a user