Description
The ConnectionQuality
property provides a measure of the quality of the network connection. It returns a value between 0 and 1, where 0 indicates a poor connection and 1 indicates an excellent connection. This property is useful for assessing the reliability and performance of the network connection.
Usage
To access the ConnectionQuality
property, you need an instance of the ConnectionStats
struct. This property is read-only and provides a real-time assessment of the connection quality.
Example
// Example of accessing the ConnectionQuality property
// Assume 'connectionStats' is an instance of ConnectionStats
ConnectionStats connectionStats = GetConnectionStats();
// Retrieve the connection quality
float quality = connectionStats.ConnectionQuality;
// Use the connection quality value
if (quality > 0.8f)
{
// Connection is good
// Perform actions that require a stable connection
}
else
{
// Connection is poor
// Consider handling network issues or notifying the user
}