forked from I2P_Developers/i2p.i2p
Util: Consolidate dup BandwidthEstimator interfaces
This commit is contained in:
@@ -1,20 +0,0 @@
|
||||
package net.i2p.client.streaming.impl;
|
||||
|
||||
/**
|
||||
* A Westwood bandwidth estimator
|
||||
*
|
||||
* @since 0.9.46
|
||||
*/
|
||||
interface BandwidthEstimator {
|
||||
|
||||
/**
|
||||
* Records an arriving ack.
|
||||
* @param acked how many packets were acked with this ack
|
||||
*/
|
||||
public void addSample(int acked);
|
||||
|
||||
/**
|
||||
* @return the current bandwidth estimate in packets/ms.
|
||||
*/
|
||||
public float getBandwidthEstimate();
|
||||
}
|
||||
@@ -17,6 +17,7 @@ import net.i2p.client.streaming.I2PSocketException;
|
||||
import net.i2p.data.DataHelper;
|
||||
import net.i2p.data.Destination;
|
||||
import net.i2p.data.SigningPublicKey;
|
||||
import net.i2p.util.BandwidthEstimator;
|
||||
import net.i2p.util.Log;
|
||||
import net.i2p.util.SimpleTimer;
|
||||
import net.i2p.util.SimpleTimer2;
|
||||
|
||||
@@ -2,6 +2,7 @@ package net.i2p.client.streaming.impl;
|
||||
|
||||
import net.i2p.I2PAppContext;
|
||||
import net.i2p.data.DataHelper;
|
||||
import net.i2p.util.BandwidthEstimator;
|
||||
import net.i2p.util.Log;
|
||||
|
||||
/**
|
||||
|
||||
20
core/java/src/net/i2p/util/BandwidthEstimator.java
Normal file
20
core/java/src/net/i2p/util/BandwidthEstimator.java
Normal file
@@ -0,0 +1,20 @@
|
||||
package net.i2p.util;
|
||||
|
||||
/**
|
||||
* A Westwood bandwidth estimator
|
||||
*
|
||||
* @since 0.9.46 consolidated from streaming and udp in 0.9.50
|
||||
*/
|
||||
public interface BandwidthEstimator {
|
||||
|
||||
/**
|
||||
* Records an arriving ack.
|
||||
* @param acked how many bytes or packets were acked with this ack
|
||||
*/
|
||||
public void addSample(int acked);
|
||||
|
||||
/**
|
||||
* @return the current bandwidth estimate in bytes/ms or packets/ms.
|
||||
*/
|
||||
public float getBandwidthEstimate();
|
||||
}
|
||||
@@ -1,20 +0,0 @@
|
||||
package net.i2p.router.transport.udp;
|
||||
|
||||
/**
|
||||
* A Westwood bandwidth estimator
|
||||
*
|
||||
* @since 0.9.49 adapted from streaming
|
||||
*/
|
||||
interface BandwidthEstimator {
|
||||
|
||||
/**
|
||||
* Records an arriving ack.
|
||||
* @param acked how many bytes were acked with this ack
|
||||
*/
|
||||
public void addSample(int acked);
|
||||
|
||||
/**
|
||||
* @return the current bandwidth estimate in bytes/ms.
|
||||
*/
|
||||
public float getBandwidthEstimate();
|
||||
}
|
||||
@@ -24,6 +24,7 @@ import net.i2p.router.transport.udp.InboundMessageFragments.ModifiableLong;
|
||||
import net.i2p.router.util.CachedIteratorCollection;
|
||||
import net.i2p.router.util.CoDelPriorityBlockingQueue;
|
||||
import net.i2p.router.util.PriBlockingQueue;
|
||||
import net.i2p.util.BandwidthEstimator;
|
||||
import net.i2p.util.Log;
|
||||
import net.i2p.util.ConcurrentHashSet;
|
||||
|
||||
|
||||
@@ -2,6 +2,7 @@ package net.i2p.router.transport.udp;
|
||||
|
||||
import net.i2p.I2PAppContext;
|
||||
import net.i2p.data.DataHelper;
|
||||
import net.i2p.util.BandwidthEstimator;
|
||||
import net.i2p.util.Log;
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user