FNFSMessageHeader

Simple wrapper for sending and receiving atomic packets

Choose your operating system:

Windows

macOS

Linux

References

Module

Sockets

Header

/Engine/Source/Runtime/Sockets/Public/NetworkMessage.h

Include

#include "NetworkMessage.h"

Syntax

struct FNFSMessageHeader

Remarks

Simple wrapper for sending and receiving atomic packets

Variables

Name Description

Public variable

uint32

 

Magic

Magic number, used for error checking and endianess checking

Public variable

uint32

 

PayloadCrc

CRC of payload

Public variable

uint32

 

PayloadSize

Size of payload

Constructors

Name Description

Public function

FNFSMessageHeader

(
    const FSimpleAbstractSocket& InSoc...
)

Constructor for empty header

Public function

FNFSMessageHeader

(
    const FSimpleAbstractSocket& InSoc...,
    const TArray< uint8 >& Payload
)

Constructor for a header of a given payload

Functions

Name Description

Public function Static

bool

 

ReceivePayload

(
    FArrayReader& OutPayload,
    const FSimpleAbstractSocket& Socke...
)

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

Public function Static

bool

 

SendPayloadAndReceiveResponse

(
    const TArray< uint8 >& Payload,
    FArrayReader& Response,
    const FSimpleAbstractSocket& Socke...
)

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

Public function Static

bool

 

WrapAndSendPayload

(
    const TArray< uint8 >& Payload,
    const FSimpleAbstractSocket& Socke...
)

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