net.DisableBandwithThrottling

net.DisableBandwithThrottling

#Overview

name: net.DisableBandwithThrottling

This variable is created as a Console Variable (cvar).

It is referenced in 3 C++ source files.

#Summary

#Usage in the C++ source code

The purpose of net.DisableBandwithThrottling is to force the IsNetReady function to always return true, effectively disabling bandwidth throttling in the Unreal Engine’s networking system. This setting is primarily used for debugging and testing purposes.

This setting variable is used in the Unreal Engine’s networking subsystem, specifically within the UNetConnection class. It’s part of the Engine module and affects how the engine manages network bandwidth utilization.

The value of this variable is set as a console variable (CVar) in the NetConnection.cpp file. It’s initialized with a default value of 0, meaning bandwidth throttling is enabled by default.

The associated variable CVarDisableBandwithThrottling directly interacts with net.DisableBandwithThrottling. They share the same value and purpose.

Developers must be aware of several important points when using this variable:

  1. It’s only available in non-shipping builds (#if !UE_BUILD_SHIPPING).
  2. When enabled (set to a value greater than 0), it bypasses normal bandwidth throttling mechanisms, which could lead to network congestion or performance issues if used incorrectly.
  3. It’s intended for debugging and testing purposes only and should not be used in production environments.

Best practices when using this variable include:

  1. Only use it temporarily for debugging network-related issues.
  2. Always remember to disable it after testing to ensure proper network behavior.
  3. Be cautious about using it in multiplayer scenarios, as it could affect all clients connected to the server.
  4. Document any usage of this variable in testing procedures to ensure it’s not accidentally left enabled.

Regarding the associated variable CVarDisableBandwithThrottling:

#References in C++ code

#Callsites

This variable is referenced in the following C++ source code:

#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/NetConnection.cpp:94

Scope: file

Source code excerpt:


#if !UE_BUILD_SHIPPING
static TAutoConsoleVariable<int32> CVarDisableBandwithThrottling(TEXT("net.DisableBandwithThrottling"), 0,
	TEXT("Forces IsNetReady to always return true. Not available in shipping builds."));
#endif

TAutoConsoleVariable<int32> CVarNetEnableCongestionControl(TEXT("net.EnableCongestionControl"), 0,
	TEXT("Enables congestion control module."));

#Associated Variable and Callsites

This variable is associated with another variable named CVarDisableBandwithThrottling. They share the same value. See the following C++ source code.

#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/NetConnection.cpp:94

Scope: file

Source code excerpt:


#if !UE_BUILD_SHIPPING
static TAutoConsoleVariable<int32> CVarDisableBandwithThrottling(TEXT("net.DisableBandwithThrottling"), 0,
	TEXT("Forces IsNetReady to always return true. Not available in shipping builds."));
#endif

TAutoConsoleVariable<int32> CVarNetEnableCongestionControl(TEXT("net.EnableCongestionControl"), 0,
	TEXT("Enables congestion control module."));

#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/NetConnection.cpp:2397

Scope (from outer to inner):

file
function     int32 UNetConnection::IsNetReady

Source code excerpt:


#if !(UE_BUILD_SHIPPING || UE_BUILD_TEST)
	if (CVarDisableBandwithThrottling.GetValueOnAnyThread() > 0)
	{
		return 1;
	}
#endif

	if (NetworkCongestionControl.IsSet())