UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
FNFSMessageHeader Struct Reference

#include <NetworkMessage.h>

Public Member Functions

 FNFSMessageHeader (const FSimpleAbstractSocket &InSocket)
 
 FNFSMessageHeader (const FSimpleAbstractSocket &InSocket, const TArray< uint8 > &Payload)
 

Static Public Member Functions

static SOCKETS_API bool WrapAndSendPayload (const TArray< uint8 > &Payload, const FSimpleAbstractSocket &Socket)
 
static SOCKETS_API bool ReceivePayload (FArrayReader &OutPayload, const FSimpleAbstractSocket &Socket)
 
static SOCKETS_API bool SendPayloadAndReceiveResponse (const TArray< uint8 > &Payload, class FArrayReader &Response, const FSimpleAbstractSocket &Socket)
 

Public Attributes

uint32 Magic
 
uint32 PayloadSize
 
uint32 PayloadCrc
 

Friends

FArchiveoperator<< (FArchive &Ar, FNFSMessageHeader &Header)
 

Detailed Description

Simple wrapper for sending and receiving atomic packets

Constructor & Destructor Documentation

◆ FNFSMessageHeader() [1/2]

FNFSMessageHeader::FNFSMessageHeader ( const FSimpleAbstractSocket InSocket)
inline

Constructor for empty header

◆ FNFSMessageHeader() [2/2]

FNFSMessageHeader::FNFSMessageHeader ( const FSimpleAbstractSocket InSocket,
const TArray< uint8 > &  Payload 
)
inline

Constructor for a header of a given payload

Member Function Documentation

◆ ReceivePayload()

bool FNFSMessageHeader::ReceivePayload ( FArrayReader OutPayload,
const FSimpleAbstractSocket Socket 
)
static

This function will receive a header, and then the payload array from the network

Parameters
OutPayloadThe archive to read into (the response is APPENDed to any data in the archive already, and the archive will be seeked to the start of new data)
SocketThe socket to read from
Returns
true if successful

◆ SendPayloadAndReceiveResponse()

bool FNFSMessageHeader::SendPayloadAndReceiveResponse ( const TArray< uint8 > &  Payload,
class FArrayReader Response,
const FSimpleAbstractSocket Socket 
)
static

This function will send a payload data (with header) and wait for a response, serializing the response to a FBufferArchive

Parameters
PayloadBytes to send over the network
ResponseThe archive to read the response into
SocketConnection to send the header and payload
Returns
true if successful

◆ WrapAndSendPayload()

bool FNFSMessageHeader::WrapAndSendPayload ( const TArray< uint8 > &  Payload,
const FSimpleAbstractSocket Socket 
)
static

This function will create a header for the payload, then send the header and payload over the network

Parameters
PayloadBytes to send over the network
SocketConnection to send the header and payload
Returns
true if successful

Friends And Related Symbol Documentation

◆ operator<<

FArchive & operator<< ( FArchive Ar,
FNFSMessageHeader Header 
)
friend

Serializer for header

Member Data Documentation

◆ Magic

uint32 FNFSMessageHeader::Magic

Magic number, used for error checking and endianess checking

◆ PayloadCrc

uint32 FNFSMessageHeader::PayloadCrc

CRC of payload

◆ PayloadSize

uint32 FNFSMessageHeader::PayloadSize

Size of payload


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