#include <RemoteViz/Rendering/NetworkPerformance.h>
Public Member Functions | |
void | enableCalibration (bool val) |
Enable or disable network performance calibration. | |
bool | isCalibrationEnabled () const |
Return if the network performance calibration is enabled. | |
void | setMaxCalibrationDuration (unsigned int val) |
Sets the network performance calibration maximum duration in milliseconds. | |
unsigned int | getMaxCalibrationDuration () const |
Gets the network performance calibration maximum duration in milliseconds. | |
unsigned int | getBandwidth () const |
Gets the estimated network bandwidth between the service and the client. | |
unsigned int | getLatency () const |
Gets the estimated network latency (round-trip time) between the service and the client. | |
This class manages measures of service quality of the network.
RemoteViz will pass an instance of this class to the methods ServiceListener::onConnectedClient() and ServiceListener::onInitializedClient().
If calibration is enabled (true by default), RemoteViz will measure available network bandwidth and latency when a client first connects to the service (between the onConnectedClient and onInitializedClient calls) and store the values in this object. These measures are used to adjust image quality or frames per second (see ConnectionSettings::setFrameEncodingPolicy). The default implementation of ServiceListener::onInitializedClient() will query the measured bandwidth value (getBandwidth) and call ClientSettings::setBandwidth().
To measure available network bandwidth, RemoteViz has to cause network congestion, which implies that the user is blocked for a period of time. Therefore RemoteViz only measures network bandwidth once for each client, when the client first connects (and only if calibration is enabled). To disable calibration or change the duration of the calibration, implement the ServiceListener::onConnectedClient() method.
Definition at line 64 of file NetworkPerformance.h.
void RemoteViz::Rendering::NetworkPerformance::enableCalibration | ( | bool | val | ) |
Enable or disable network performance calibration.
Default value is true.
If calibration is enabled, a measurement of the latency and bandwidth is performed after the first connection establishment and before sending frames. If calibration is disabled, the estimated bandwidth and latency will be 0. It is better to reduce the calibration time rather than disable completely.
val | : true to enable, false to disable |
unsigned int RemoteViz::Rendering::NetworkPerformance::getBandwidth | ( | ) | const |
Gets the estimated network bandwidth between the service and the client.
Default is 0 when the object is first created, but RemoteViz will set this value if network calibration is enabled.
This value influences the quality and the number of interactive frames sent to the client (see ConnectionSettings::setFrameEncodingPolicy). The higher the value, the better the quality and the number of interactive frames. This value is estimated during the network calibration step (if enabled).
unsigned int RemoteViz::Rendering::NetworkPerformance::getLatency | ( | ) | const |
Gets the estimated network latency (round-trip time) between the service and the client.
Default is 0 when the object is first created, but RemoteViz will set this value if network calibration is enabled.
This value influences the quality of interactions. The lower the value, the better the user interactions. This value is estimated during the network calibration step (if enabled).
unsigned int RemoteViz::Rendering::NetworkPerformance::getMaxCalibrationDuration | ( | ) | const |
Gets the network performance calibration maximum duration in milliseconds.
Default value is 5 seconds. Frames will be send to the client after this duration.
bool RemoteViz::Rendering::NetworkPerformance::isCalibrationEnabled | ( | ) | const |
Return if the network performance calibration is enabled.
Default is true.
void RemoteViz::Rendering::NetworkPerformance::setMaxCalibrationDuration | ( | unsigned int | val | ) |
Sets the network performance calibration maximum duration in milliseconds.
Default value is 5 seconds. Frames will be send to the client after this duration. Reducing calibration time reduces the accuracy of the measurements.
val | : max calibration duration in milliseconds |