NetworkEmulation Class Reference

#include <NetworkEmulation.h>

List of all members.

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)


Detailed Description

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.

Member Enumeration Documentation

enum ConnectionTypes

Enumeration for the SetConnection function for standard types of connection

Enumerator:
kPerfect  No packet loss, latency or bandwidth impairment.
kModem28k  Simulates a 28k analogue modem
kModem56k  Simulates a 56k analogue modem
kDSL512MB_Down128Up  Simulates a common type of DSL connection
kLAN  Simulates a LAN network


Member Function Documentation

static void SetEnabled ( const bool  enable = false  )  [static]

Allows the network emulation to be turned on or off

Parameters:
enable set this to be true or false to turn on or off the network emulation. The default is false.

static bool GetEnabled ( void   )  [static]

Allows the network emulation activation status to be read

Returns:
true is the network emulation is enabled

static void SetConnection ( const ConnectionTypes  type = kPerfect,
const bool  enable = true 
) [static]

Allows the network emulation parameters to be set quickly for various standard testing types

Parameters:
type the type of connection to emulate
enable enable or disable the emulation

static void SetPacketLoss ( const float  percent = 0  )  [static]

This sets the emulated packet loss for the network layer.

Parameters:
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.

static float GetPacketLoss ( void   )  [static]

This allows the configured emulated packet loss to be read.

Returns:
the emulated packet loss value

static void SetMaximumOutputBandwidth ( const int  bytesPerSecond = 0  )  [static]

Sets the maximum output bandwidth for emulation.

Parameters:
bytesPerSecond the bandwidth in bytes per second. The default value is 0 meaning there is no limit.

static int GetMaximumOutputBandwidth ( void   )  [static]

Reads the configuration value set by SetMaximumOutputBandwidth()

Returns:
the configured value

static void SetMaximumInputBandwidth ( const int  bytesPerSecond = 0  )  [static]

Sets the maximum input bandwidth for emulation.

Parameters:
bytesPerSecond the bandwidth in bytes per second. The default value is 0 meaning there is no limit.

static int GetMaximumInputBandwidth ( void   )  [static]

Reads the configuration value set by GetMaximumInputBandwidth().

Returns:
the configured value

static void SetAverageLatency ( const float  seconds = 0.0f  )  [static]

Sets the average packet latency, this is half round trip time.

Parameters:
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 float GetAverageLatency ( void   )  [static]

Reads the configuration value set by SetAverageLatency()

Returns:
the configured value

static void SetJitter ( const float  seconds = 0.0f  )  [static]

Allows the amount by which the latency value can fluctuate

Parameters:
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 float GetJitter ( void   )  [static]

Reads the configuration value set by SetJitter()

Returns:
the configured value


Generated on Sat Jun 28 22:02:29 2008 for ReplicaNet and RNLobby by  doxygen 1.5.3