Transport: Fix NTCP countPeers()

O/P conn limit adjustment
This commit is contained in:
zzz
2015-04-16 21:55:43 +00:00
parent 69c2ed77a0
commit 6c954f0b68
3 changed files with 7 additions and 6 deletions

View File

@@ -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;

View File

@@ -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.

View File

@@ -2239,7 +2239,6 @@ public class UDPTransport extends TransportImpl implements TimedWeightedPriority
super.afterSend(m, true);
}
@Override
public int countPeers() {
return _peersByIdent.size();
}