Description
The InPacketsPerSecond
property of the ConnectionStats
struct provides the rate at which packets are being received from a network connection. This value is expressed in packets per second and is useful for monitoring the incoming data flow to ensure the connection is performing as expected.
Usage
To access the InPacketsPerSecond
property, you need an instance of the ConnectionStats
struct. This property is read-only and provides a float
value representing the current rate of incoming packets.
Example
// Example of accessing the InPacketsPerSecond property
// Assume 'connectionStats' is an instance of ConnectionStats
float incomingPacketsRate = connectionStats.InPacketsPerSecond;
// Use the incomingPacketsRate to monitor or log the network performance
if (incomingPacketsRate < 10.0f)
{
// Handle low packet rate scenario
// For example, log a warning or adjust network settings
}