UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
IPAddressBSDIOS.h
Go to the documentation of this file.
1// Copyright Epic Games, Inc. All Rights Reserved.
2
3#pragma once
4
5#include "CoreMinimal.h"
9
10#if PLATFORM_HAS_BSD_IPV6_SOCKETS
11
13{
14public:
15
18 {
19 }
20
22 virtual void SetIPv6BroadcastAddress() override
23 {
24 FSocketSubsystemIOS* SocketSubsystemIOS = static_cast<FSocketSubsystemIOS*>(SocketSubsystem);
26 {
28 if (!MultiCastAddr.IsValid())
29 {
30 UE_LOG(LogSockets, Warning, TEXT("Could not resolve the broadcast address for iOS, this address will just be blank"));
31 }
32 else
33 {
34 // Set the address from the query
35 SetRawIp(MultiCastAddr->GetRawIp());
36
37 // Grab the scope id to set the broadcast address to
38 // We could potentially do this with less loops but it's best to make sure that we set an IPv6 scope
39 // And iOS could return an IPv4 address if we just called GetLocalHostAddr
41 if (BindingAddresses.Num() > 0)
42 {
43 for (const auto& BindAddress : BindingAddresses)
44 {
45 if (BindAddress->GetProtocolType() == FNetworkProtocolTypes::IPv6)
46 {
47 uint32 ScopeId = StaticCastSharedRef<FInternetAddrBSDIOS>(BindAddress)->GetScopeId();
48 SetScopeId(ScopeId);
49 break;
50 }
51 }
52 }
53 else
54 {
55 UE_LOG(LogSockets, Warning, TEXT("Could not get binding addresses to set the internal scope id for the broadcast address"));
56 }
57 }
58 }
59 else
60 {
61 UE_LOG(LogSockets, Warning, TEXT("Could not get the socketsubsystem for querying the scope id of the broadcast address"));
62 }
63 SetPort(0);
64 }
65};
66
67#endif
#define TEXT(x)
Definition Platform.h:1272
UE_FORCEINLINE_HINT TSharedRef< CastToType, Mode > StaticCastSharedRef(TSharedRef< CastFromType, Mode > const &InSharedRef)
Definition SharedPointer.h:127
#define UE_LOG(CategoryName, Verbosity, Format,...)
Definition LogMacros.h:270
uint32_t uint32
Definition binka_ue_file_header.h:6
Definition NameTypes.h:617
Definition SocketSubsystemIOS.h:13
Definition Array.h:670
Definition SharedPointer.h:692
const FLazyName IPv6(TEXT("IPv6"))
Definition SocketTypes.h:28