Package org.red5.server.stream.bandwidth
Class ServerClientDetection
java.lang.Object
org.red5.server.stream.bandwidth.ServerClientDetection
- All Implemented Interfaces:
IPendingServiceCallback,IBandwidthDetection
public class ServerClientDetection
extends Object
implements IPendingServiceCallback, IBandwidthDetection
Calculates the bandwidth between the client and server. The checks originate from the server.
- Author:
- The Red5 Project, Dan Rossi, Paul Gregoire
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate IConnectionprivate doubleprivate doubleprivate doubleprivate doubleprivate doubleprivate static final doubleprivate static final doubleprivate static org.slf4j.Loggerprivate AtomicIntegerprivate AtomicIntegerprivate byte[]private byte[]private longprivate longprivate long -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidcalculateClientBw(IConnection conn) private voidcallBWCheck(Object payload) private voidvoidcheckBandwidth(IConnection conn) voidvoidHandle callback from service call.
-
Field Details
-
log
private static org.slf4j.Logger log -
LATENCY_MAX
private static final double LATENCY_MAX- See Also:
-
LATENCY_MIN
private static final double LATENCY_MIN- See Also:
-
conn
-
latency
private volatile double latency -
cumLatency
private volatile double cumLatency -
kbitDown
private double kbitDown -
deltaDown
private double deltaDown -
deltaTime
private double deltaTime -
startBytesWritten
private long startBytesWritten -
startTime
private long startTime -
timePassed
private long timePassed -
packetsSent
-
packetsReceived
-
payload
private byte[] payload -
payload1
private byte[] payload1
-
-
Constructor Details
-
ServerClientDetection
public ServerClientDetection()
-
-
Method Details
-
checkBandwidth
- Specified by:
checkBandwidthin interfaceIBandwidthDetection
-
calculateClientBw
- Specified by:
calculateClientBwin interfaceIBandwidthDetection
-
resultReceived
Handle callback from service call.- Specified by:
resultReceivedin interfaceIPendingServiceCallback- Parameters:
call- Call object this callback is applied to
-
callBWCheck
-
callBWDone
private void callBWDone() -
onServerClientBWCheck
public void onServerClientBWCheck()
-