UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
ChildConnection.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#include "ChildConnection.generated.h"
10
11namespace UE::Net
12{
14 {
15 None = 0,
16 SendCloseMessage = (1 << 0), /* Send the NMT_CloseChildConnection control message to the remote endpoint (client/server). */
17 DestroyActors = (1 << 1) /* Destroy all actors associated with the child connection. */
18 };
20}
21
25UCLASS(MinimalAPI,transient,config=Engine)
28{
33
34public:
35
37
38 // UNetConnection interface.
39
41 {
42 return this;
43 }
44
45 virtual FString LowLevelGetRemoteAddress(bool bAppendPort=false) override
46 {
47 return Parent->LowLevelGetRemoteAddress(bAppendPort);
48 }
49
50 virtual FString LowLevelDescribe() override
51 {
52 return Parent->LowLevelDescribe();
53 }
54
55 virtual void LowLevelSend(void* Data, int32 CountBits, FOutPacketTraits& Traits) override
56 {
57 }
58
59 virtual void InitSendBuffer() override
60 {
61 Parent->InitSendBuffer();
62 }
63
64 virtual void AssertValid() override
65 {
66 Parent->AssertValid();
67 }
68
69 virtual void FlushNet(bool bIgnoreSimulation = false) override
70 {
71 Parent->FlushNet(bIgnoreSimulation);
72 }
73
74 UE_DEPRECATED(5.6, "Replaced with a version that doesn't have a saturate option.")
75 virtual int32 IsNetReady(bool Saturate) override
76 {
78 return Parent->IsNetReady(Saturate);
80 }
81
82 virtual bool IsNetReady() const override
83 {
84 return Parent->IsNetReady();
85 }
86
87 virtual bool IsEncryptionEnabled() const override
88 {
89 return Parent->IsEncryptionEnabled();
90 }
91
92 virtual void Tick(float DeltaSeconds) override
93 {
94 SetConnectionState(Parent->GetConnectionState());
95 }
96 ENGINE_API virtual void GracefulClose(FNetCloseResult&& CloseReason) override;
97 ENGINE_API virtual void HandleClientPlayer(class APlayerController* PC, class UNetConnection* NetConnection) override;
98 ENGINE_API virtual void CleanUp() override;
99
101 ENGINE_API void CloseAndRemoveChild(UE::Net::ECloseChildFlags Flags);
102
105
106 ENGINE_API virtual void InitChildConnection(UNetDriver* InDriver, UNetConnection* InParent);
107
108private:
109 void AssignConnectionHandle();
110};
#define UE_DEPRECATED(Version, Message)
Definition CoreMiscDefines.h:302
FPlatformTypes::int32 int32
A 32-bit signed integer.
Definition Platform.h:1125
UE_FORCEINLINE_HINT TSharedRef< CastToType, Mode > StaticCastSharedRef(TSharedRef< CastFromType, Mode > const &InSharedRef)
Definition SharedPointer.h:127
#define ENUM_CLASS_FLAGS(Enum)
Definition EnumClassFlags.h:6
#define PRAGMA_ENABLE_DEPRECATION_WARNINGS
Definition GenericPlatformCompilerPreSetup.h:12
#define PRAGMA_DISABLE_DEPRECATION_WARNINGS
Definition GenericPlatformCompilerPreSetup.h:8
EConnectionState
Definition NetConnection.h:94
#define UPROPERTY(...)
UObject definition macros.
Definition ObjectMacros.h:744
#define GENERATED_UCLASS_BODY(...)
Definition ObjectMacros.h:768
#define UCLASS(...)
Definition ObjectMacros.h:776
Definition PlayerController.h:261
Definition Engine.Build.cs:7
Definition IPAddress.h:22
Definition Sockets.h:19
Definition ChildConnection.h:28
virtual bool IsNetReady() const override
Definition ChildConnection.h:82
virtual void Tick(float DeltaSeconds) override
Definition ChildConnection.h:92
virtual void InitLocalConnection(UNetDriver *InDriver, class FSocket *InSocket, const FURL &InURL, EConnectionState InState, int32 InMaxPacket=0, int32 InPacketOverhead=0) override
Definition ChildConnection.h:104
virtual void InitRemoteConnection(UNetDriver *InDriver, class FSocket *InSocket, const FURL &InURL, const class FInternetAddr &InRemoteAddr, EConnectionState InState, int32 InMaxPacket=0, int32 InPacketOverhead=0) override
Definition ChildConnection.h:103
virtual bool IsEncryptionEnabled() const override
Definition ChildConnection.h:87
virtual UChildConnection * GetUChildConnection() override
Definition ChildConnection.h:40
virtual void LowLevelSend(void *Data, int32 CountBits, FOutPacketTraits &Traits) override
Definition ChildConnection.h:55
virtual void InitSendBuffer() override
Definition ChildConnection.h:59
UNetConnection * GetParentConnection()
Definition ChildConnection.h:36
virtual void AssertValid() override
Definition ChildConnection.h:64
virtual void FlushNet(bool bIgnoreSimulation=false) override
Definition ChildConnection.h:69
virtual FString LowLevelDescribe() override
Definition ChildConnection.h:50
virtual FString LowLevelGetRemoteAddress(bool bAppendPort=false) override
Definition ChildConnection.h:45
Definition NetConnection.h:284
Definition NetDriver.h:799
@ None
Definition ReplicationDataStreamDebug.h:25
Definition NetworkVersion.cpp:28
ECloseChildFlags
Definition ChildConnection.h:14
TNetResult< ENetCloseResult > FNetCloseResult
Definition NetCloseResult.h:425
Definition PacketTraits.h:21
Definition EngineBaseTypes.h:799
Definition ObjectPtr.h:488
Definition NetResult.h:330