Files
UnrealEngineUWP/Engine/Source/Runtime/Networking/Private/IPv4/IPv4Endpoint.cpp
T
ryan durand 0f0464a30e Updating copyright for Engine Runtime.
#rnx
#rb none


#ROBOMERGE-OWNER: ryan.durand
#ROBOMERGE-AUTHOR: ryan.durand
#ROBOMERGE-SOURCE: CL 10869210 via CL 10869511 via CL 10869900
#ROBOMERGE-BOT: (v613-10869866)

[CL 10870549 by ryan durand in Main branch]
2019-12-26 14:45:42 -05:00

47 lines
1.1 KiB
C++

// Copyright Epic Games, Inc. All Rights Reserved.
#include "Interfaces/IPv4/IPv4Endpoint.h"
/* FIPv4Endpoint static initialization
*****************************************************************************/
const FIPv4Endpoint FIPv4Endpoint::Any(FIPv4Address(0, 0, 0, 0), 0);
ISocketSubsystem* FIPv4Endpoint::CachedSocketSubsystem = nullptr;
/* FIPv4Endpoint interface
*****************************************************************************/
FString FIPv4Endpoint::ToString() const
{
return FString::Printf(TEXT("%s:%i"), *Address.ToString(), Port);
}
/* FIPv4Endpoint static interface
*****************************************************************************/
void FIPv4Endpoint::Initialize()
{
CachedSocketSubsystem = ISocketSubsystem::Get(PLATFORM_SOCKETSUBSYSTEM);
}
bool FIPv4Endpoint::Parse(const FString& EndpointString, FIPv4Endpoint& OutEndpoint)
{
TArray<FString> Tokens;
if (EndpointString.ParseIntoArray(Tokens, TEXT(":"), false) == 2)
{
if (FIPv4Address::Parse(Tokens[0], OutEndpoint.Address))
{
OutEndpoint.Port = FCString::Atoi(*Tokens[1]);
return true;
}
}
return false;
}