Navigation
API > API/Runtime > API/Runtime/HTTP
Inheritance Hierarchy
- FTSTickerObjectBase
- FHttpManager
References
| Module | HTTP |
| Header | /Engine/Source/Runtime/Online/HTTP/Public/HttpManager.h |
| Include | #include "HttpManager.h" |
Syntax
class FHttpManager : public FTSTickerObjectBase
Remarks
Manages Http request that are currently being processed
Variables
| Type | Name | Description | |
|---|---|---|---|
| bool | bFlushing | This variable is set to true in Flush(EHttpFlushReason), and prevents new Http requests from being launched. | |
| bool | bUseEventLoop | ||
| FCriticalSection | CompletedRequestLock | Used to lock access to get completed requests | |
| TFunction< FString()> | CorrelationIdMethod | This method will be called to generate a CorrelationId on all requests being sent if one is not already set | |
| TMap< EHttpFlushReason, FHttpFlushTimeLimit > | FlushTimeLimitsMap | ||
| FTSTicker | GameThreadTicker | Ticker to run game thread tasks | |
| FCriticalSection | GameThreadTickerLock | ||
| FHttpStats | HttpStats | ||
| FHttpStatsHistory | HttpStatsHistory | ||
| FHttpManagerRequestAddedDelegate | RequestAddedDelegate | Delegate that will get called once request added | |
| FHttpManagerRequestCompletedDelegate | RequestCompletedDelegate | Delegate that will get called when a request completes | |
| FCriticalSection | RequestLock | Used to lock access to add/remove/find requests | |
| TArray< FHttpRequestRef > | Requests | List of Http requests that are actively being processed | |
| FHttpThreadBase * | Thread | ||
| TArray< FString > | UrlPatternsToLogResponse | ||
| FCriticalSection | UrlPatternsToLogResponseCriticalSection | ||
| TMap< FString, int32 > | UrlPatternsToMockFailure | ||
| FCriticalSection | UrlPatternsToMockFailureCriticalSection | ||
| UE::Core::FURLRequestFilter | URLRequestFilter | Url request filter, if specified in the config, it will launch http request only when the url is in the allowlist |
Constructors
| Type | Name | Description | |
|---|---|---|---|
FHttpManager () |
Constructor |
Destructors
| Type | Name | Description | |
|---|---|---|---|
| Destructor |
Functions
| Type | Name | Description | |
|---|---|---|---|
| void | AddGameThreadTask
(
TFunction< void()>&& Task, |
Add task to be ran on the game thread next tick | |
| TSharedPtr< IHttpTaskTimerHandle > | AddHttpThreadTask
(
TFunction< void()>&& Task, |
Add task to be ran on the http thread | |
| void | AddRequest
(
const FHttpRequestRef& Request |
Adds an Http request instance to the manager for tracking/ticking Manager should always have a list of requests currently being processed | |
| PRAGMA_DISABLE_DEPRECATION_WARNINGS void | AddThreadedRequest
(
const TSharedRef< FHttpRequestCommon, ESPMode::ThreadSafe >& Request |
Add a http request to be executed on the http thread | |
| void | BroadcastHttpRequestCompleted
(
const FHttpRequestRef& Request |
Broadcast that a non-threaded HTTP request is complete. | |
| void | CancelThreadedRequest
(
const TSharedRef< FHttpRequestCommon, ESPMode::ThreadSafe >& Request |
Mark a threaded http request as cancelled to be removed from the http thread | |
| FString | Create a new correlation id for a request | ||
| FHttpThreadBase * | Create HTTP thread object | ||
| void | DumpRequests
(
FOutputDevice& Ar |
List all of the Http requests currently being processed | |
| void | Flush
(
EHttpFlushReason FlushReason |
Block until all pending requests are finished processing | |
| void | FlushTick
(
float DeltaSeconds |
Tick called during Flush | |
| TFunction< FString()> | Get the default method for creating new correlation ids for a request | ||
| FHttpStats | GetHttpStats () |
||
| TOptional< int32 > | GetMockFailure
(
FStringView Url |
||
| FHttpThreadBase * | GetThread () |
Access http thread of http manager for internal usage | |
| bool | |||
| void | Initialize () |
Initialize | |
| bool | IsDomainAllowed
(
const FString& Url |
Determine if the domain is allowed to be accessed | |
| bool | IsValidRequest
(
const IHttpRequest* RequestPtr |
Find an Http request in the lists of current valid requests | |
| void | OnAfterFork () |
Inform that HTTP Manager that we have completed a fork(). | |
| void | OnBeforeFork () |
Inform that HTTP Manager that we are about to fork(). | |
| void | Inform the HTTP Manager that we finished ticking right after forking. | ||
| void | RecordMaxTimeToWaitInQueue
(
float Duration |
Record the time to wait in queue, to have a general idea how long the client usually wait before actually starting, to adjust the requests | |
| void | RecordPlatformStats
(
const FHttpStatsPlatform& PlatformStats |
Record platform specific stats | |
| void | RecordStatRequestsInFlight
(
uint32 RequestsInFlight |
Record the requests waiting in flight, to have an idea if there are too many concurrent requests | |
| void | RecordStatRequestsInQueue
(
uint32 RequestsInQueue |
Record the requests waiting in queue, to have an idea if there are too many requests or if request number limit is too small | |
| void | RecordStatTimeToConnect
(
float Duration |
Record the time to connect, to have a general idea how long the client usually take to connect for success requests, to adjust the connection timeout | |
| void | |||
| void | RemoveHttpThreadTask
(
TSharedPtr< IHttpTaskTimerHandle > HttpTaskTimerHandle |
Remove the task from the http thread before it's triggered | |
| void | RemoveRequest
(
const FHttpRequestRef& Request |
Removes an Http request instance from the manager Presumably it is done being processed | |
| void | SetCorrelationIdMethod
(
TFunction< FString()> InCorrelationIdMethod |
Set the method used to set a Correlation id on each request, if one is not already specified. | |
| void | SetRequestAddedDelegate
(
const FHttpManagerRequestAddedDelegate& Delegate |
Set a delegate to be triggered when an http request added to http manager. | |
| void | SetRequestCompletedDelegate
(
const FHttpManagerRequestCompletedDelegate& Delegate |
Set a delegate to be triggered when an http request completed. | |
| void | SetURLRequestFilter
(
const UE::Core::FURLRequestFilter& InURLRequestFilter |
Set url request filter through code, instead of setting it through config. | |
| bool | ShouldLogResponse
(
FStringView Url |
||
| void | Shutdown () |
Shutdown logic should be called before quiting | |
| bool | Method to check dynamic proxy setting support. | ||
| void | Update configuration. Called when config has been updated and we need to apply any changes. | ||
| void | |||
| void |
Overridden from FTSTickerObjectBase
Classes
| Type | Name | Description | |
|---|---|---|---|
| FHttpFlushTimeLimit | |||
| FHttpStatsHistory |