ISocketSubsystem::GetAddressInfoAsync

Async variant of GetAddressInfo that fetches the data from the above function in an asynchronous task executed on an available background thread.

Windows
MacOS
Linux

References

Module

Sockets

Header

/Engine/Source/Runtime/Sockets/Public/SocketSubsystem.h

Include

#include "SocketSubsystem.h"

Source

/Engine/Source/Runtime/Sockets/Private/SocketSubsystem.cpp

Syntax

virtual void GetAddressInfoAsync
(
    FAsyncGetAddressInfoCallback Callback,
    const TCHAR * HostName,
    const TCHAR * ServiceName,
    EAddressInfoFlags QueryFlags,
    const FName ProtocolTypeName,
    ESocketType SocketType
)

Remarks

Async variant of GetAddressInfo that fetches the data from the above function in an asynchronous task executed on an available background thread.

On Completion, this fires a callback function that will be executed on the same thread as the task's execution. The caller is responsible for either dispatching the result to the thread of their choosing or to allow the result callback execute on the task's thread.

This function allows for specifying FNames for the protocol type, allowing for support of other platform protocols

Parameters

Parameter

Description

Callback

the callback function to fire when this query completes. Contains the FAddressInfoResult structure.

HostName

string version of the queryable hostname or ip address

ServiceName

string version of a service name ("http") or a port number ("80")

QueryFlags

What flags are used in making the getaddrinfo call. Several flags can be used at once by bitwise OR-ing the flags together. Platforms are required to translate this value into a the correct flag representation.

ProtocolTypeName

Used to limit results from the call. Specifying None will search all valid protocols. Callers will find they rarely have to specify this flag.

SocketType

What socket type should the results be formatted for. This typically does not change any formatting results and can be safely left to the default value.

Help shape the future of Unreal Engine documentation! Tell us how we're doing so we can serve you better.
Take our survey
Dismiss