HttpSendTimeout

HttpSendTimeout

#Overview

name: HttpSendTimeout

The value of this variable can be defined or overridden in .ini config files. 1 .ini config file referencing this setting variable.

It is referenced in 5 C++ source files.

#Summary

#Usage in the C++ source code

The purpose of HttpSendTimeout is to set a timeout value for sending HTTP requests in Unreal Engine 5. This setting is primarily used by the HTTP module to control how long the engine will wait for a request to be sent before timing out.

The HTTP module in Unreal Engine’s Online subsystem relies on this setting variable. It is used in the FHttpModule class, which is part of the HTTP runtime module.

The value of this variable is set in multiple places:

  1. It’s initialized in the FHttpModule::StartupModule function with a default value equal to HttpConnectionTimeout.
  2. It can be updated from the configuration file (GEngineIni) in the FHttpModule::UpdateConfigs function.
  3. It can be explicitly set in other parts of the code, as seen in the CrashReportClientApp.cpp file.

HttpSendTimeout interacts with other HTTP-related variables such as HttpActivityTimeout, HttpReceiveTimeout, and HttpConnectionTimeout. These variables work together to manage different aspects of HTTP communication timeouts.

Developers should be aware that:

  1. This variable affects the timeout for sending HTTP requests, which can impact the responsiveness and behavior of network-dependent features.
  2. Changing this value can affect the performance and reliability of HTTP communications in the game or application.
  3. The value is in seconds, so care should be taken when setting it to ensure it’s appropriate for the expected network conditions.

Best practices when using this variable include:

  1. Adjust the value based on the specific needs of your application and expected network conditions.
  2. Consider the trade-off between allowing enough time for requests to complete and preventing excessively long waits that could affect user experience.
  3. Use in conjunction with other HTTP timeout settings for a comprehensive approach to managing network communications.
  4. Monitor and log timeout occurrences to identify potential issues with network performance or configuration.
  5. Consider allowing this value to be configurable in release builds to adapt to different deployment environments.

#Setting Variables

#References In INI files

Location: <Workspace>/Engine/Config/ConfigRedirects.ini:65, section: [HTTP]

#References in C++ code

#Callsites

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

#Loc: <Workspace>/Engine/Source/Programs/CrashReportClient/Private/CrashReportClientApp.cpp:1078

Scope (from outer to inner):

file
function     void RunCrashReportClient

Source code excerpt:

	check(GConfig && GConfig->IsReadyForUse());

	// Increase the HttpSendTimeout to 5 minutes
	GConfig->SetFloat(TEXT("HTTP"), TEXT("HttpSendTimeout"), 5 * 60.0f, GEngineIni);

	// Make sure all UObject classes are registered and default properties have been initialized
	ProcessNewlyLoadedUObjects();

	// Tell the module manager is may now process newly-loaded UObjects when new C++ modules are loaded
	FModuleManager::Get().StartProcessingNewlyLoadedObjects();

#Loc: <Workspace>/Engine/Source/Runtime/Online/HTTP/Private/HttpModule.cpp:56

Scope (from outer to inner):

file
function     void FHttpModule::UpdateConfigs

Source code excerpt:

	GConfig->GetFloat(TEXT("HTTP"), TEXT("HttpActivityTimeout"), HttpActivityTimeout, GEngineIni);
	GConfig->GetFloat(TEXT("HTTP"), TEXT("HttpReceiveTimeout"), HttpReceiveTimeout, GEngineIni);
	GConfig->GetFloat(TEXT("HTTP"), TEXT("HttpSendTimeout"), HttpSendTimeout, GEngineIni);
	GConfig->GetInt(TEXT("HTTP"), TEXT("HttpMaxConnectionsPerServer"), HttpMaxConnectionsPerServer, GEngineIni);
	GConfig->GetBool(TEXT("HTTP"), TEXT("bEnableHttp"), bEnableHttp, GEngineIni);
	GConfig->GetBool(TEXT("HTTP"), TEXT("bUseNullHttp"), bUseNullHttp, GEngineIni);
	GConfig->GetFloat(TEXT("HTTP"), TEXT("HttpDelayTime"), HttpDelayTime, GEngineIni);
	GConfig->GetFloat(TEXT("HTTP"), TEXT("HttpThreadActiveFrameTimeInSeconds"), HttpThreadActiveFrameTimeInSeconds, GEngineIni);
	GConfig->GetFloat(TEXT("HTTP"), TEXT("HttpThreadActiveMinimumSleepTimeInSeconds"), HttpThreadActiveMinimumSleepTimeInSeconds, GEngineIni);

#Loc: <Workspace>/Engine/Source/Runtime/Online/HTTP/Private/HttpModule.cpp:90

Scope (from outer to inner):

file
function     void FHttpModule::StartupModule

Source code excerpt:

	HttpActivityTimeout = 30.0f;
	HttpReceiveTimeout = HttpConnectionTimeout;
	HttpSendTimeout = HttpConnectionTimeout;
	HttpMaxConnectionsPerServer = 16;
	bEnableHttp = true;
	bUseNullHttp = false;
	HttpDelayTime = 0;
	HttpThreadActiveFrameTimeInSeconds = 1.0f / 200.0f; // 200Hz
	HttpThreadActiveMinimumSleepTimeInSeconds = 0.0f;

#Loc: <Workspace>/Engine/Source/Runtime/Online/HTTP/Public/HttpModule.h:130

Scope (from outer to inner):

file
class        class FHttpModule : public IModuleInterface, public FSelfRegisteringExec
function     inline float GetHttpSendTimeout

Source code excerpt:

	inline float GetHttpSendTimeout() const
	{
		return HttpSendTimeout;
	}

	/**
	 * @return timeout in seconds to check there is any ongoing activity on the established connection
	 */
	inline float GetHttpActivityTimeout() const

#Loc: <Workspace>/Engine/Source/Runtime/Online/HTTP/Public/HttpModule.h:380

Scope (from outer to inner):

file
class        class FHttpModule : public IModuleInterface, public FSelfRegisteringExec

Source code excerpt:

	float HttpReceiveTimeout;
	/** timeout in seconds to send a request on the connection */
	float HttpSendTimeout;
	/** total time to delay the request */
	float HttpDelayTime;
	/** Time in seconds to use as frame time when actively processing requests. 0 means no frame time. */
	float HttpThreadActiveFrameTimeInSeconds;
	/** Time in seconds to sleep minimally when actively processing requests. */
	float HttpThreadActiveMinimumSleepTimeInSeconds;