00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011 #ifndef __NETWORKEMULATION_H__
00012 #define __NETWORKEMULATION_H__
00013 #include "RNPlatform/Inc/DLLExportAPI.h"
00014
00015 namespace RNReplicaNet
00016 {
00017
00023 class XPURLDLL_API NetworkEmulation
00024 {
00025 public:
00026
00031 static void SetEnabled(const bool enable = false);
00032
00037 static bool GetEnabled(void);
00038
00042 enum ConnectionTypes
00043 {
00044 kPerfect = 0,
00045 kModem28k,
00046 kModem56k,
00047 kDSL512MB_Down128Up,
00048 kLAN
00049 };
00050
00056 static void SetConnection(const ConnectionTypes type = kPerfect,const bool enable = true);
00057
00062 static void SetPacketLoss(const float percent = 0);
00063
00068 static float GetPacketLoss(void);
00069
00074 static void SetMaximumOutputBandwidth(const int bytesPerSecond = 0);
00075
00080 static int GetMaximumOutputBandwidth(void);
00081
00086 static void SetMaximumInputBandwidth(const int bytesPerSecond = 0);
00087
00092 static int GetMaximumInputBandwidth(void);
00093
00098 static void SetAverageLatency(const float milliSeconds = 0.0f);
00099
00104 static float GetAverageLatency(void);
00105
00110 static void SetJitter(const float milliSeconds = 0.0f);
00111
00116 static float GetJitter(void);
00117
00118 private:
00119 NetworkEmulation() {};
00120 virtual ~NetworkEmulation() {};
00121 };
00122
00123 }
00124
00125 #endif