engine
 
载入中...
搜索中...
未找到
Public 成员函数 | 静态 Public 成员函数 | Public 属性 | 友元 | 所有成员列表
FNFSMessageHeader结构体 参考

Simple wrapper for sending and receiving atomic packets 更多...

#include <NetworkMessage.h>

Public 成员函数

 FNFSMessageHeader (const FSimpleAbstractSocket &InSocket)
 Constructor for empty header
 
 FNFSMessageHeader (const FSimpleAbstractSocket &InSocket, const TArray< uint8 > &Payload)
 Constructor for a header of a given payload
 

静态 Public 成员函数

static bool ReceivePayload (FArrayReader &OutPayload, const FSimpleAbstractSocket &Socket)
 This function will receive a header, and then the payload array from the network 更多...
 
static bool SendPayloadAndReceiveResponse (const TArray< uint8 > &Payload, class FArrayReader &Response, const FSimpleAbstractSocket &Socket)
 This function will send a payload data (with header) and wait for a response, serializing the response to a FBufferArchive 更多...
 
static bool WrapAndSendPayload (const TArray< uint8 > &Payload, const FSimpleAbstractSocket &Socket)
 This function will create a header for the payload, then send the header and payload over the network 更多...
 

Public 属性

uint32 Magic
 Magic number, used for error checking and endianess checking
 
uint32 PayloadCrc
 CRC of payload
 
uint32 PayloadSize
 Size of payload
 

友元

FArchive & operator<< (FArchive &Ar, FNFSMessageHeader &Header)
 Serializer for header
 

详细描述

Simple wrapper for sending and receiving atomic packets

成员函数说明

◆ ReceivePayload()

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

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

参数
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
返回
true if successful

◆ SendPayloadAndReceiveResponse()

static 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

参数
PayloadBytes to send over the network
ResponseThe archive to read the response into
SocketConnection to send the header and payload
返回
true if successful

◆ WrapAndSendPayload()

static 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

参数
PayloadBytes to send over the network
SocketConnection to send the header and payload
返回
true if successful

该结构体的文档由以下文件生成: