forked from I2P_Developers/i2p.i2p
Transport: Fix NTCP countPeers()
O/P conn limit adjustment
This commit is contained in:
@@ -107,10 +107,8 @@ public abstract class TransportImpl implements Transport {
|
||||
|
||||
/**
|
||||
* How many peers are we connected to?
|
||||
* For NTCP, this is the same as active,
|
||||
* but SSU actually looks at idle time for countActivePeers()
|
||||
*/
|
||||
public int countPeers() { return countActivePeers(); }
|
||||
public abstract int countPeers();
|
||||
|
||||
/**
|
||||
* How many peers are we currently connected to, that we have
|
||||
@@ -161,10 +159,10 @@ public abstract class TransportImpl implements Transport {
|
||||
def *= 4;
|
||||
break;
|
||||
case Router.CAPABILITY_BW256:
|
||||
def *= 6;
|
||||
def *= 7;
|
||||
break;
|
||||
case Router.CAPABILITY_BW512:
|
||||
def *= 8;
|
||||
def *= 9;
|
||||
break;
|
||||
case Router.CAPABILITY_BW_UNLIMITED:
|
||||
def *= 12;
|
||||
|
@@ -492,6 +492,10 @@ public class NTCPTransport extends TransportImpl {
|
||||
return removed;
|
||||
}
|
||||
|
||||
public int countPeers() {
|
||||
return _conByIdent.size();
|
||||
}
|
||||
|
||||
/**
|
||||
* How many peers have we talked to in the last 5 minutes?
|
||||
* As of 0.9.20, actually returns active peer count, not total.
|
||||
|
@@ -2239,7 +2239,6 @@ public class UDPTransport extends TransportImpl implements TimedWeightedPriority
|
||||
super.afterSend(m, true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int countPeers() {
|
||||
return _peersByIdent.size();
|
||||
}
|
||||
|
Reference in New Issue
Block a user