ReplicaNet and RNLobby  1
NetworkEmulation.h
1 /* START_LICENSE_HEADER
2 
3 Copyright (C) 2000 Martin Piper, original design and program code
4 Copyright (C) 2001 Replica Software
5 
6 This program file is copyright (C) Replica Software and can only be used under license.
7 For more information visit: http://www.replicanet.com/
8 Or email: info@replicanet.com
9 
10 END_LICENSE_HEADER */
11 #include "RNPlatform/Inc/MemoryTracking.h"
12 #ifndef __NETWORKEMULATION_H__
13 #define __NETWORKEMULATION_H__
14 
15 namespace RNReplicaNet
16 {
17 
24 {
25 public:
26 
31  static void SetEnabled(const bool enable = false);
32 
37  static bool GetEnabled(void);
38 
43  {
44  kPerfect = 0,
49  };
50 
56  static void SetConnection(const ConnectionTypes type = kPerfect,const bool enable = true);
57 
62  static void SetPacketLoss(const float percent = 0);
63 
68  static float GetPacketLoss(void);
69 
74  static void SetMaximumOutputBandwidth(const int bytesPerSecond = 0);
75 
80  static int GetMaximumOutputBandwidth(void);
81 
86  static void SetMaximumInputBandwidth(const int bytesPerSecond = 0);
87 
92  static int GetMaximumInputBandwidth(void);
93 
98  static void SetAverageLatency(const float seconds = 0.0f);
99 
104  static float GetAverageLatency(void);
105 
110  static void SetJitter(const float seconds = 0.0f);
111 
116  static float GetJitter(void);
117 
118 private:
119  NetworkEmulation() {};
120  virtual ~NetworkEmulation() {};
121 };
122 
123 } // namespace RNReplicaNet
124 
125 #endif
static float GetJitter(void)
ConnectionTypes
Definition: NetworkEmulation.h:42
static int GetMaximumOutputBandwidth(void)
Definition: NetworkEmulation.h:45
static int GetMaximumInputBandwidth(void)
static void SetPacketLoss(const float percent=0)
static float GetAverageLatency(void)
static void SetConnection(const ConnectionTypes type=kPerfect, const bool enable=true)
Definition: NetworkEmulation.h:44
Definition: NetworkEmulation.h:23
Definition: NetworkEmulation.h:48
static float GetPacketLoss(void)
Definition: NetworkEmulation.h:46
static void SetEnabled(const bool enable=false)
static void SetMaximumInputBandwidth(const int bytesPerSecond=0)
static bool GetEnabled(void)
static void SetJitter(const float seconds=0.0f)
static void SetMaximumOutputBandwidth(const int bytesPerSecond=0)
static void SetAverageLatency(const float seconds=0.0f)