Created
July 21, 2020 23:02
-
-
Save mminer/ed778252cf1e4004faaf7cc625fad1bc to your computer and use it in GitHub Desktop.
Unreal Engine utility function to get the host's IP address.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Include "Sockets" in the `PrivateDependencyModuleNames` list in the Build.cs file. | |
#include "SocketSubsystem.h" | |
FString GetHost() | |
{ | |
bool bCanBindAll; | |
return ISocketSubsystem::Get(PLATFORM_SOCKETSUBSYSTEM)->GetLocalHostAddr(*GLog, bCanBindAll)->ToString(false); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment