NetworkEmulation.h

00001 /* START_LICENSE_HEADER
00002 
00003 Copyright (C) 2000 Martin Piper, original design and program code
00004 Copyright (C) 2001 Replica Software
00005 
00006 This program file is copyright (C) Replica Software and can only be used under license.
00007 For more information visit: http://www.replicanet.com/
00008 Or email: info@replicanet.com
00009 
00010 END_LICENSE_HEADER */
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 seconds = 0.0f);
00099 
00104     static float GetAverageLatency(void);
00105 
00110     static void SetJitter(const float seconds = 0.0f);
00111 
00116     static float GetJitter(void);
00117 
00118 private:
00119     NetworkEmulation() {};
00120     virtual ~NetworkEmulation() {};
00121 };
00122 
00123 } // namespace RNReplicaNet
00124 
00125 #endif

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