ReplicaNet and RNLobby
1
|
#include <NetworkEmulation.h>
Public Types | |
enum | ConnectionTypes { kPerfect = 0, kModem28k, kModem56k, kDSL512MB_Down128Up, kLAN } |
Static Public Member Functions | |
static void | SetEnabled (const bool enable=false) |
static bool | GetEnabled (void) |
static void | SetConnection (const ConnectionTypes type=kPerfect, const bool enable=true) |
static void | SetPacketLoss (const float percent=0) |
static float | GetPacketLoss (void) |
static void | SetMaximumOutputBandwidth (const int bytesPerSecond=0) |
static int | GetMaximumOutputBandwidth (void) |
static void | SetMaximumInputBandwidth (const int bytesPerSecond=0) |
static int | GetMaximumInputBandwidth (void) |
static void | SetAverageLatency (const float seconds=0.0f) |
static float | GetAverageLatency (void) |
static void | SetJitter (const float seconds=0.0f) |
static float | GetJitter (void) |
NetworkEmulation allows various emulated network settings to be changed to allow the user to test their application with emulated packet loss, latency, jitter and bandwidth controls.
This class is a static access class.
enum ConnectionTypes |
Enumeration for the SetConnection function for standard types of connection
|
static |
Reads the configuration value set by SetAverageLatency()
|
static |
Allows the network emulation activation status to be read
|
static |
Reads the configuration value set by SetJitter()
|
static |
Reads the configuration value set by GetMaximumInputBandwidth().
|
static |
Reads the configuration value set by SetMaximumOutputBandwidth()
|
static |
This allows the configured emulated packet loss to be read.
|
static |
Sets the average packet latency, this is half round trip time.
milliSeconds | the latency in seconds. So setting this to be 0.1f will mean a packet latency of 100ms is used. The default value is 0 meaning there is no latency. |
|
static |
Allows the network emulation parameters to be set quickly for various standard testing types
type | the type of connection to emulate |
enable | enable or disable the emulation |
|
static |
Allows the network emulation to be turned on or off
enable | set this to be true or false to turn on or off the network emulation. The default is false. |
|
static |
Allows the amount by which the latency value can fluctuate
milliSeconds | the jitter in seconds. So setting this to be 0.05f and latency to 0.1f will mean a packet latency of 50ms to 150ms (100ms +-50ms) can be used. The default value is 0 meaning there is no jitter. |
|
static |
Sets the maximum input bandwidth for emulation.
bytesPerSecond | the bandwidth in bytes per second. The default value is 0 meaning there is no limit. |
|
static |
Sets the maximum output bandwidth for emulation.
bytesPerSecond | the bandwidth in bytes per second. The default value is 0 meaning there is no limit. |
|
static |
This sets the emulated packet loss for the network layer.
percent | Sets the emulated packet loss level where percent is any value from 0 to 100 percent packet loss. The default value is 0 meaning no packet loss. |