UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
UE::Net::Private::FReliableNetBlobQueue Class Reference

#include <ReliableNetBlobQueue.h>

Classes

struct  FReplicationRecord
 

Public Member Functions

 FReliableNetBlobQueue ()
 
 ~FReliableNetBlobQueue ()
 
uint32 GetUnsentBlobCount () const
 
bool HasUnsentBlobs () const
 
bool IsAllSentAndAcked () const
 
bool IsSendWindowFull () const
 
IRISCORE_API bool IsSafeToDestroy () const
 
IRISCORE_API bool Enqueue (const TRefCountPtr< FNetBlob > &Blob)
 
IRISCORE_API const TRefCountPtr< FNetBlob > * Peek ()
 
IRISCORE_API void Pop ()
 
IRISCORE_API void DequeueUnreliable (TArray< TRefCountPtr< FNetBlob > > &Unreliable)
 
IRISCORE_API SIZE_T GetUnreliableCount () const
 
IRISCORE_API void DropUnreliable ()
 
IRISCORE_API uint32 SerializeWithObject (FNetSerializationContext &Context, FNetRefHandle RefHandle, FReplicationRecord &OutRecord)
 
IRISCORE_API uint32 DeserializeWithObject (FNetSerializationContext &Context, FNetRefHandle RefHandle)
 
IRISCORE_API uint32 Serialize (FNetSerializationContext &Context, FReplicationRecord &OutRecord)
 
IRISCORE_API uint32 Deserialize (FNetSerializationContext &Context)
 
IRISCORE_API void CommitReplicationRecord (const FReplicationRecord &Record)
 
IRISCORE_API void ProcessPacketDeliveryStatus (EPacketDeliveryStatus Status, const FReplicationRecord &Record)
 

Static Public Attributes

static constexpr uint32 MaxUnackedBlobCount = 1024U
 

Detailed Description

Helper class to deliver blobs reliably in order.

Constructor & Destructor Documentation

◆ FReliableNetBlobQueue()

UE::Net::Private::FReliableNetBlobQueue::FReliableNetBlobQueue ( )

◆ ~FReliableNetBlobQueue()

UE::Net::Private::FReliableNetBlobQueue::~FReliableNetBlobQueue ( )

Member Function Documentation

◆ CommitReplicationRecord()

void UE::Net::Private::FReliableNetBlobQueue::CommitReplicationRecord ( const FReplicationRecord Record)

Call after a packet containing serialized data was sent.

See also
SerializeWithObject, Serialize

◆ DequeueUnreliable()

void UE::Net::Private::FReliableNetBlobQueue::DequeueUnreliable ( TArray< TRefCountPtr< FNetBlob > > &  Unreliable)

On the receiving end this will move all received unreliable NetBlobs to the array and release them from the queue. This breaks the ordering guarantees provided by using Peek and Pop. Reliable NetBlobs are unaffected by this operation.

◆ Deserialize()

uint32 UE::Net::Private::FReliableNetBlobQueue::Deserialize ( FNetSerializationContext Context)

Deserializes blobs with object using their respective Deserialize() method.

Returns
The number of blobs that were deserialized.
See also
Serialize

◆ DeserializeWithObject()

uint32 UE::Net::Private::FReliableNetBlobQueue::DeserializeWithObject ( FNetSerializationContext Context,
FNetRefHandle  RefHandle 
)

Deserializes blobs with object using their respective DeserializeWithObject() method.

Returns
The number of blobs that were deserialized.
See also
SerializeWithObject

◆ DropUnreliable()

void UE::Net::Private::FReliableNetBlobQueue::DropUnreliable ( )

On sending side this will drop all unreliable in the queue to avoid creating a backlog of unsent unreliable blobs

◆ Enqueue()

bool UE::Net::Private::FReliableNetBlobQueue::Enqueue ( const TRefCountPtr< FNetBlob > &  Blob)

Put a blob to be sent in the queue. Returns true if the blob was successfully queued and false if the queue was full.

◆ GetUnreliableCount()

SIZE_T UE::Net::Private::FReliableNetBlobQueue::GetUnreliableCount ( ) const

Count all unreliable blobs

◆ GetUnsentBlobCount()

uint32 UE::Net::Private::FReliableNetBlobQueue::GetUnsentBlobCount ( ) const
inline

Returns the number of blobs that have not yet been sent.

◆ HasUnsentBlobs()

bool UE::Net::Private::FReliableNetBlobQueue::HasUnsentBlobs ( ) const
inline

Returns true if there are unsent blobs. There may still be unacked blobs even if there are no unsent ones.

◆ IsAllSentAndAcked()

bool UE::Net::Private::FReliableNetBlobQueue::IsAllSentAndAcked ( ) const
inline

Returns whether all blobs have been sent and acknowledged as received.

◆ IsSafeToDestroy()

bool UE::Net::Private::FReliableNetBlobQueue::IsSafeToDestroy ( ) const

Returns true if it's safe to destroy this queue.

◆ IsSendWindowFull()

bool UE::Net::Private::FReliableNetBlobQueue::IsSendWindowFull ( ) const
inline

Returns whether the send window is full or not.

◆ Peek()

const TRefCountPtr< FNetBlob > * UE::Net::Private::FReliableNetBlobQueue::Peek ( )

On the receiving end this will return a pointer to the next blob that can be processed.

◆ Pop()

void UE::Net::Private::FReliableNetBlobQueue::Pop ( )

On the receiving end this will remove the next blob to be processed from the queue. Call after processing the blob returned from Peek().

◆ ProcessPacketDeliveryStatus()

void UE::Net::Private::FReliableNetBlobQueue::ProcessPacketDeliveryStatus ( EPacketDeliveryStatus  Status,
const FReplicationRecord Record 
)

For each packet for which CommitReplicationRecord() was called ProcessPacketDeliveryStatus() needs to be called in the same order when it's known whether the packet was delivered or not.

Parameters
StatusWhether the packet was delivered or not or if the record should simply be discarded due to closing a connection.
RecordThe record that was obtained via a Serialize/SerializeWithObject call and passed to CommitReplicationRecord.
See also
CommitReplicationRecord

◆ Serialize()

uint32 UE::Net::Private::FReliableNetBlobQueue::Serialize ( FNetSerializationContext Context,
FReliableNetBlobQueue::FReplicationRecord OutRecord 
)

Serializes as many blobs as possible using their respective Serialize() method.

Parameters
ContextA FNetSerializationContext.
OutRecordThe record to pass to CommitReplicationRecord() if a packet containing the serialized data was sent.
Returns
The number of blobs that were serialized.

◆ SerializeWithObject()

uint32 UE::Net::Private::FReliableNetBlobQueue::SerializeWithObject ( FNetSerializationContext Context,
FNetRefHandle  RefHandle,
FReliableNetBlobQueue::FReplicationRecord OutRecord 
)

Serializes as many blobs as possible using their respective SerializeWithObject() method. It is assumed the NetRefHandle will be reconstructed somehow on the receiving end and passed to DeserializeWithObject(). This provides an opportunity for FNetObjectAttachments, such as FNetRPCs, to avoid serializing the same NetRefHandle redundantly.

Parameters
ContextA FNetSerializationContext.
RefHandleThe handle for the blobs' target object.
OutRecordThe record to pass to CommitReplicationRecord() if a packet containing the serialized data was sent.
Returns
The number of blobs that were serialized.

Member Data Documentation

◆ MaxUnackedBlobCount

constexpr uint32 UE::Net::Private::FReliableNetBlobQueue::MaxUnackedBlobCount = 1024U
staticconstexpr

This represents a ReplicationRecord where nothing was serialized. How many blobs can be sent before an ACK/NAK is required to continue sending. Changing this might require changing FReplicationRecord too.


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