MessageBus.UDP.BadEndpointPeriod

MessageBus.UDP.BadEndpointPeriod

#Overview

name: MessageBus.UDP.BadEndpointPeriod

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 MessageBus.UDP.BadEndpointPeriod is to define the time period, in seconds, between endpoint socket errors that would classify an endpoint as “bad” in the UDP messaging system of Unreal Engine.

This setting variable is primarily used in the UDP Messaging plugin, which is part of Unreal Engine’s messaging system. Specifically, it’s utilized in the UdpMessageTransport module, which handles UDP-based message transportation.

The value of this variable is set using a console variable (CVar) system. It’s defined with a default value of 60 seconds, but can be modified at runtime or through configuration files.

The associated variable CVarBadEndpointPeriod directly interacts with MessageBus.UDP.BadEndpointPeriod. They share the same value and purpose.

Developers must be aware that this variable affects how the system determines problematic endpoints in UDP messaging. A shorter period might lead to more aggressive classification of bad endpoints, while a longer period could be more lenient.

Best practices when using this variable include:

  1. Adjusting the value based on network conditions and application requirements.
  2. Monitoring endpoint behavior in conjunction with this setting to ensure optimal performance.
  3. Consider the trade-offs between quickly identifying bad endpoints and potentially misclassifying temporary network issues.

Regarding CVarBadEndpointPeriod: This is the C++ variable that directly represents MessageBus.UDP.BadEndpointPeriod in the code. It’s used in the HandleEndpointError function to determine if an endpoint should be considered as failing repeatedly. The value is retrieved using GetValueOnAnyThread(), which suggests it can be safely accessed from multiple threads.

Developers should note that changes to CVarBadEndpointPeriod will immediately affect the behavior of the UDP message transport system. It’s crucial to thoroughly test any modifications to ensure they don’t negatively impact the overall messaging system performance or reliability.

#References in C++ code

#Callsites

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

#Loc: <Workspace>/Engine/Plugins/Messaging/UdpMessaging/Source/UdpMessaging/Private/Transport/UdpMessageTransport.cpp:24

Scope: file

Source code excerpt:


TAutoConsoleVariable<int32> CVarBadEndpointPeriod(
	TEXT("MessageBus.UDP.BadEndpointPeriod"),
	60,
	TEXT("The period of time, in seconds, between endpoint socket errors to be considered a bad endpoint."),
	ECVF_Default
);

TAutoConsoleVariable<bool> CVarEndpointDenyListEnabled(

#Associated Variable and Callsites

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

#Loc: <Workspace>/Engine/Plugins/Messaging/UdpMessaging/Source/UdpMessaging/Private/Transport/UdpMessageTransport.cpp:23

Scope: file

Source code excerpt:

);

TAutoConsoleVariable<int32> CVarBadEndpointPeriod(
	TEXT("MessageBus.UDP.BadEndpointPeriod"),
	60,
	TEXT("The period of time, in seconds, between endpoint socket errors to be considered a bad endpoint."),
	ECVF_Default
);

#Loc: <Workspace>/Engine/Plugins/Messaging/UdpMessaging/Source/UdpMessaging/Private/Transport/UdpMessageTransport.cpp:77

Scope (from outer to inner):

file
namespace    UE::UdpMessageTransport::Private
function     void HandleEndpointError

Source code excerpt:

		FDenyCandidate& DenyCandidate = DenyCandidateList.FindOrAdd(EndpointId);
		FDateTime CurrentTime = FDateTime::UtcNow();
		if ((CurrentTime - DenyCandidate.LastFailTime).GetSeconds() < CVarBadEndpointPeriod.GetValueOnAnyThread())
		{
			DenyCandidate.EndpointFailureCount++;
		}
		else
		{
			DenyCandidate.EndpointFailureCount = 0;