![]() |
UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
|
#include <NetPacketNotify.h>
Classes | |
| struct | FNotificationHeader |
Public Types | |
| enum | { SequenceNumberBits = 14 } |
| enum | { MaxSequenceHistoryLength = 256 } |
| typedef TSequenceNumber< SequenceNumberBits, uint16 > | SequenceNumberT |
| typedef TSequenceHistory< MaxSequenceHistoryLength > | SequenceHistoryT |
Public Member Functions | |
| FNetPacketNotify () | |
| void | Init (SequenceNumberT InitialInSeq, SequenceNumberT InitialOutSeq) |
| void | AckSeq (SequenceNumberT Seq) |
| void | NakSeq (SequenceNumberT Seq) |
| SequenceNumberT | CommitAndIncrementOutSeq () |
| bool | WriteHeader (FBitWriter &Writer, bool bRefresh=false) |
| bool | ReadHeader (FNotificationHeader &Data, FBitReader &Reader) const |
| SequenceNumberT::DifferenceT | GetSequenceDelta (const FNotificationHeader &NotificationData) |
| template<class Functor > | |
| SequenceNumberT::DifferenceT | Update (const FNotificationHeader &NotificationData, Functor &&InFunc) |
| const SequenceHistoryT & | GetInSeqHistory () const |
| SequenceNumberT | GetInSeq () const |
| SequenceNumberT | GetInAckSeq () const |
| SequenceNumberT | GetOutSeq () const |
| SequenceNumberT | GetOutAckSeq () const |
| bool | CanSend () const |
| bool | IsSequenceWindowFull (uint32 SafetyMargin=0U) const |
| SequenceNumberT::DifferenceT | GetCurrentSequenceHistoryLength () const |
| bool | IsWaitingForSequenceHistoryFlush () const |
FNetPacketNotify - Drives delivery of sequence numbers, acknowledgments and notifications of delivery sequence numbers
| FNetPacketNotify::FNetPacketNotify | ( | ) |
Constructor
|
inline |
Mark Seq as received and update current InSeq, missing sequence numbers will be marked as lost
|
inline |
If we do have more unacknowledged sequence numbers in-flight than our maximum sendwindow we should not send more as the receiving end will not be able to detect if the sequence number has wrapped around
| FNetPacketNotify::SequenceNumberT FNetPacketNotify::CommitAndIncrementOutSeq | ( | ) |
Increment outgoing seq number and commit data
| FNetPacketNotify::SequenceNumberT::DifferenceT FNetPacketNotify::GetCurrentSequenceHistoryLength | ( | ) | const |
Get the current sequenceHistory length in bits, clamped to the maximum history length
|
inline |
Get the last received sequence number that we have accepted, InAckSeq cannot be larger than InSeq
|
inline |
Get the last received in sequence number
|
inline |
Get the current SequenceHistory
|
inline |
Get the last outgoing sequence number acknowledged by remote
|
inline |
Get the current outgoing sequence number
|
inline |
Gets the delta between the present sequence, and the sequence inside the specified header - if the delta is positive
| void FNetPacketNotify::Init | ( | SequenceNumberT | InitialInSeq, |
| SequenceNumberT | InitialOutSeq | ||
| ) |
Init notification with expected initial sequence numbers
Return whether we can send packets without exhausting the packet sequence history window, as it could cause packets to be NAKed even when they've been received by the remote peer.
| SafetyMargin | A small number representing how many packets you would like to keep as a safety margin for heart beats or other important packets. |
|
inline |
Returns true if we are currently waiting for a flush of the sequence window
|
inline |
Explicitly mark Seq as not received and update current InSeq, additional missing sequence numbers will be marked as lost
| bool FNetPacketNotify::ReadHeader | ( | FNotificationHeader & | Data, |
| FBitReader & | Reader | ||
| ) | const |
Read header from stream
| FNetPacketNotify::SequenceNumberT::DifferenceT FNetPacketNotify::Update | ( | const FNotificationHeader & | NotificationData, |
| Functor && | InFunc | ||
| ) |
Update state of PacketNotification based on received header and invoke packet notifications for received acks.
| NotificationData | The header to update from |
| InFunc | A function in the format (void)(FNetPacketNotify::SequenceNumberT AckedSequence, bool bDelivered) to handle packet notifications. |
| bool FNetPacketNotify::WriteHeader | ( | FBitWriter & | Writer, |
| bool | bRefresh = false |
||
| ) |
Write NotificationHeader, and update outgoing ack record if bRefresh is true we will attempt to refresh a previously written header if the resulting size will be the same as the already written header. returns true if data was written, and false if no data was written which might be the case if we try to rewrite an existing header but the required size differs.