UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
StatelessConnectHandlerComponent Class Reference

#include <StatelessConnectHandlerComponent.h>

+ Inheritance diagram for StatelessConnectHandlerComponent:

Public Member Functions

ENGINE_API StatelessConnectHandlerComponent ()
 
virtual ENGINE_API void CountBytes (FArchive &Ar) const override
 
virtual bool IsValid () const override
 
virtual ENGINE_API void NotifyHandshakeBegin () override
 
ENGINE_API void InitFromConnectionless (StatelessConnectHandlerComponent *InConnectionlessHandler)
 
ENGINE_API void SetHandshakeFailureCallback (FHandshakeFailureFunc &&InHandshakeFailureFunc)
 
bool HasPassedChallenge (const TSharedPtr< const FInternetAddr > &Address, bool &bOutRestartedHandshake) const
 
void GetChallengeSequence (int32 &OutServerSequence, int32 &OutClientSequence) const
 
bool DoesRestartedHandshakeMatch (StatelessConnectHandlerComponent &NetConnComponent) const
 
void ResetChallengeData ()
 
ENGINE_API void SetDriver (UNetDriver *InDriver)
 
- Public Member Functions inherited from HandlerComponent
PACKETHANDLER_API HandlerComponent ()
 
PACKETHANDLER_API HandlerComponent (FName InName)
 
virtual PACKETHANDLER_API ~HandlerComponent ()
 
virtual PACKETHANDLER_API bool IsActive () const
 
PACKETHANDLER_API bool IsInitialized () const
 
bool RequiresHandshake () const
 
bool RequiresReliability () const
 
virtual void Incoming (FIncomingPacketRef PacketRef)
 
virtual void OutgoingConnectionless (const TSharedPtr< const FInternetAddr > &Address, FBitWriter &Packet, FOutPacketTraits &Traits)
 
virtual void InitFaultRecovery (UE::Net::FNetConnectionFaultRecoveryBase *InFaultRecovery)
 
virtual PACKETHANDLER_API void SetActive (bool Active)
 
FName GetName () const
 
virtual void NotifyAnalyticsProvider ()
 

Protected Member Functions

virtual ENGINE_API void Initialize () override
 
virtual ENGINE_API void Incoming (FBitReader &Packet) override
 
virtual ENGINE_API void Outgoing (FBitWriter &Packet, FOutPacketTraits &Traits) override
 
virtual ENGINE_API void IncomingConnectionless (FIncomingPacketRef PacketRef) override
 
virtual bool CanReadUnaligned () const override
 
virtual ENGINE_API int32 GetReservedPacketBits () const override
 
virtual ENGINE_API void Tick (float DeltaTime) override
 
- Protected Member Functions inherited from HandlerComponent
PACKETHANDLER_API void SetState (UE::Handler::Component::State State)
 
PACKETHANDLER_API void Initialized ()
 

Additional Inherited Members

- Public Attributes inherited from HandlerComponent
PacketHandlerHandler
 
- Protected Attributes inherited from HandlerComponent
UE::Handler::Component::State State
 
uint32 MaxOutgoingBits
 
bool bRequiresHandshake
 
bool bRequiresReliability
 

Detailed Description

PacketHandler component for implementing a stateless (non-memory-consuming) connection handshake

Partially based on the Datagram Transport Layer Security protocol.

Constructor & Destructor Documentation

◆ StatelessConnectHandlerComponent()

StatelessConnectHandlerComponent::StatelessConnectHandlerComponent ( )

Base constructor

Member Function Documentation

◆ CanReadUnaligned()

virtual bool StatelessConnectHandlerComponent::CanReadUnaligned ( ) const
inlineoverrideprotectedvirtual

Whether or not the Incoming/IncomingConnectionless implementations, support reading Packets that aren't aligned at bit position 0 (i.e. whether or not this handler supports bit-level, rather than byte-level, reads)

Returns
Whether or not the above is supported

Reimplemented from HandlerComponent.

◆ CountBytes()

void StatelessConnectHandlerComponent::CountBytes ( FArchive Ar) const
overridevirtual

Reimplemented from HandlerComponent.

◆ DoesRestartedHandshakeMatch()

bool StatelessConnectHandlerComponent::DoesRestartedHandshakeMatch ( StatelessConnectHandlerComponent NetConnComponent) const
inline

When a restarted handshake is completed, this is used to match it up with the existing NetConnection

Parameters
NetConnComponentThe NetConnection StatelessConnectHandlerComponent, which is being checked for a match
Returns
Whether or not the specified component, belongs to the client which restarted the handshake

◆ GetChallengeSequence()

void StatelessConnectHandlerComponent::GetChallengeSequence ( int32 OutServerSequence,
int32 OutClientSequence 
) const
inline

Used for retrieving the initial packet sequence values from the handshake data, after a successful challenge

Parameters
OutServerSequenceOutputs the initial sequence for the server
OutClientSequenceOutputs the initial sequence for the client

◆ GetReservedPacketBits()

int32 StatelessConnectHandlerComponent::GetReservedPacketBits ( ) const
overrideprotectedvirtual

Returns the amount of reserved packet/protocol bits expected from this component.

IMPORTANT: This MUST be accurate, and should represent the worst-case number of reserved bits expected from the component. If this is inaccurate, packets will randomly fail to send, in rare cases which are extremely hard to trace.

Returns
The worst-case reserved packet bits for the component

Implements HandlerComponent.

◆ HasPassedChallenge()

bool StatelessConnectHandlerComponent::HasPassedChallenge ( const TSharedPtr< const FInternetAddr > &  Address,
bool bOutRestartedHandshake 
) const
inline

Whether or not the specified connection address, has just passed the connection handshake challenge.

Parameters
AddressThe address (including port, for UIpNetDriver) being checked
bOutRestartedHandshakeWhether or not the passed challenge, was a restarted handshake for an existing NetConnection

◆ Incoming()

void StatelessConnectHandlerComponent::Incoming ( FBitReader Packet)
overrideprotectedvirtual

Reimplemented from HandlerComponent.

◆ IncomingConnectionless()

void StatelessConnectHandlerComponent::IncomingConnectionless ( FIncomingPacketRef  PacketRef)
overrideprotectedvirtual

Handles incoming packets not associated with a UNetConnection

Parameters
PacketRefReference of the packet being processed

Reimplemented from HandlerComponent.

◆ InitFromConnectionless()

void StatelessConnectHandlerComponent::InitFromConnectionless ( StatelessConnectHandlerComponent InConnectionlessHandler)

Initializes a serverside UNetConnection-associated StatelessConnect, from the connectionless StatelessConnect that negotiated the handshake.

Parameters
InConnectionlessHandlerThe connectionless StatelessConnect we're initializing from

◆ Initialize()

void StatelessConnectHandlerComponent::Initialize ( )
overrideprotectedvirtual

Initialization functionality should be placed here

Implements HandlerComponent.

◆ IsValid()

virtual bool StatelessConnectHandlerComponent::IsValid ( ) const
inlineoverridevirtual

Return whether this handler is valid

Implements HandlerComponent.

◆ NotifyHandshakeBegin()

void StatelessConnectHandlerComponent::NotifyHandshakeBegin ( )
overridevirtual

Notification to this component that it is ready to begin handshaking

Reimplemented from HandlerComponent.

◆ Outgoing()

void StatelessConnectHandlerComponent::Outgoing ( FBitWriter Packet,
FOutPacketTraits Traits 
)
overrideprotectedvirtual

Handles any outgoing packets

Parameters
PacketThe packet to be handled
TraitsTraits for the packet, passed down through the packet pipeline (likely from the NetConnection)

Reimplemented from HandlerComponent.

◆ ResetChallengeData()

void StatelessConnectHandlerComponent::ResetChallengeData ( )
inline

Used to reset cached handshake success/fail state, when done processing it

◆ SetDriver()

void StatelessConnectHandlerComponent::SetDriver ( UNetDriver InDriver)

Sets the net driver this handler is associated with

Parameters
InDriverThe net driver to set

◆ SetHandshakeFailureCallback()

void StatelessConnectHandlerComponent::SetHandshakeFailureCallback ( FHandshakeFailureFunc &&  InHandshakeFailureFunc)

Set a callback for notifying of handshake failure (clientside only).

Parameters
InHandshakeFailureFuncThe callback to use for notification.

◆ Tick()

void StatelessConnectHandlerComponent::Tick ( float  DeltaTime)
overrideprotectedvirtual

Tick functionality should be placed here

Reimplemented from HandlerComponent.


The documentation for this class was generated from the following files: