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
Modifier and TypeFieldDescriptionprivate IConnection
private double
private double
private double
private double
private double
private static final double
private static final double
private static org.slf4j.Logger
private AtomicInteger
private AtomicInteger
private byte[]
private byte[]
private long
private long
private long
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
calculateClientBw
(IConnection conn) private void
callBWCheck
(Object payload) private void
void
checkBandwidth
(IConnection conn) void
void
Handle 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:
checkBandwidth
in interfaceIBandwidthDetection
-
calculateClientBw
- Specified by:
calculateClientBw
in interfaceIBandwidthDetection
-
resultReceived
Handle callback from service call.- Specified by:
resultReceived
in interfaceIPendingServiceCallback
- Parameters:
call
- Call object this callback is applied to
-
callBWCheck
-
callBWDone
private void callBWDone() -
onServerClientBWCheck
public void onServerClientBWCheck()
-