Open 3D Engine AzNetworking API Reference  2205.0
O3DE is an open-source, fully-featured, high-fidelity, modular 3D engine for building games and simulations, available to every industry.
Public Member Functions | Friends | List of all members
AzNetworking::UdpPacketHeader Class Referencefinal

Udp packet header class. More...

#include <UdpPacketHeader.h>

Inherits AzNetworking::IPacketHeader.

Public Member Functions

 AZ_RTTI (UdpPacketHeader, "{21A11FF3-6829-4A59-9906-C06EF7F39AC1}", IPacketHeader)
 
 UdpPacketHeader ()
 Default constructor, for when receiving a header from a remote connection.
 
 UdpPacketHeader (UdpPacketTracker &packetTracker, PacketType packetType, SequenceId reliableSequence)
 
 UdpPacketHeader (PacketType packetType, PacketId packetId)
 
 UdpPacketHeader (PacketType packetType, SequenceId localSequence, SequenceId remoteSequence, SequenceId reliableSequence, BitsetChunk sequenceWindow, SequenceRolloverCount localRolloverCount)
 
PacketType GetPacketType () const override
 IPacketHeader interface.
 
PacketId GetPacketId () const override
 
bool IsPacketFlagSet (PacketFlag flag) const override
 
void SetPacketFlag (PacketFlag flag, bool value) override
 Sets the specified packet flag for this packet.
 
void SetPacketFlags (PacketFlagBitset flags)
 
bool GetIsReliable () const
 
SequenceId GetLocalSequenceId () const
 
SequenceId GetRemoteSequenceId () const
 
SequenceId GetReliableSequenceId () const
 
BitsetChunk GetSequenceWindow () const
 
SequenceRolloverCount GetSequenceRolloverCount () const
 
bool Serialize (ISerializer &serializer)
 
bool SerializePacketFlags (ISerializer &serializer)
 
- Public Member Functions inherited from AzNetworking::IPacketHeader
 AZ_TYPE_INFO (IPacketHeader, "{90A0EFE3-01A4-4F04-87CF-E98E94D49648}")
 

Friends

class UdpPacketIdWindow
 

Detailed Description

Udp packet header class.

Constructor & Destructor Documentation

◆ UdpPacketHeader() [1/3]

AzNetworking::UdpPacketHeader::UdpPacketHeader ( UdpPacketTracker packetTracker,
PacketType  packetType,
SequenceId  reliableSequence 
)

Constructor for generating a new header to send to a remote connection.

Parameters
packetTrackerpacket delivery tracker instance for the connection in question
packetTypetype of packet
reliableSequencereliable sequence value, or InvalidSequenceId if the packet is unreliable

◆ UdpPacketHeader() [2/3]

AzNetworking::UdpPacketHeader::UdpPacketHeader ( PacketType  packetType,
PacketId  packetId 
)

Constructor for generating generic header with just a packet id, used for dispatching a bulk message.

Parameters
packetTypetype of packet
packetIdpacket id we're duplicating

◆ UdpPacketHeader() [3/3]

AzNetworking::UdpPacketHeader::UdpPacketHeader ( PacketType  packetType,
SequenceId  localSequence,
SequenceId  remoteSequence,
SequenceId  reliableSequence,
BitsetChunk  sequenceWindow,
SequenceRolloverCount  localRolloverCount 
)

Full constructor for unit tests.

Parameters
packetTypetype of packet
localSequencelocal sequence number, this is the sequence for this packet instance
remoteSequenceremote sequence number for ack replication, this is the latest sequence we've received from the remote endpoint
reliableSequenceif this is a reliable packet, this is the reliable sequence number
sequenceWindowthis is the ack vector for ack replication, corresponding to remoteSequence
localRolloverCountthis is the reconstructed rollover count, used to convert localSequence to a full PacketId

Member Function Documentation

◆ GetIsReliable()

bool AzNetworking::UdpPacketHeader::GetIsReliable ( ) const
inline

Returns whether or not this header is for a reliably transmitted packet.

Returns
whether or not this header is for a reliably transmitted packet

◆ GetLocalSequenceId()

SequenceId AzNetworking::UdpPacketHeader::GetLocalSequenceId ( ) const
inline

Retrieve the local sequence from this packet header.

Returns
packet header local sequence

◆ GetPacketId()

PacketId AzNetworking::UdpPacketHeader::GetPacketId ( ) const
inlineoverridevirtual

Returns the packet id.

Returns
PacketId

Implements AzNetworking::IPacketHeader.

◆ GetReliableSequenceId()

SequenceId AzNetworking::UdpPacketHeader::GetReliableSequenceId ( ) const
inline

Retrieve the reliable sequence if this was a reliable packet, InvalidSequenceId otherwise.

Returns
packet header reliable sequence if this was a reliable packet, InvalidSequenceId otherwise

◆ GetRemoteSequenceId()

SequenceId AzNetworking::UdpPacketHeader::GetRemoteSequenceId ( ) const
inline

Retrieve the remote sequence being acked.

Returns
packet header remote sequence

◆ GetSequenceRolloverCount()

SequenceRolloverCount AzNetworking::UdpPacketHeader::GetSequenceRolloverCount ( ) const
inline

Retrieve the sequence rollover count from this packet header.

Returns
the sequence rollover count from this packet header

◆ GetSequenceWindow()

BitsetChunk AzNetworking::UdpPacketHeader::GetSequenceWindow ( ) const
inline

Retrieve the sequence window from this packet header.

Returns
the sequence window from this packet header

◆ IsPacketFlagSet()

bool AzNetworking::UdpPacketHeader::IsPacketFlagSet ( PacketFlag  flag) const
inlineoverridevirtual

Returns if the specified packet flag is set for this packet.

Returns
true if the flag is set for this packet

Implements AzNetworking::IPacketHeader.

◆ Serialize()

bool AzNetworking::UdpPacketHeader::Serialize ( ISerializer serializer)

Base serialize method for all serializable structures or classes to implement.

Parameters
serializerISerializer instance to use for serialization
Returns
boolean true for success, false for serialization failure

◆ SerializePacketFlags()

bool AzNetworking::UdpPacketHeader::SerializePacketFlags ( ISerializer serializer)

Specialized serialize method for UDP Packet Flags

Parameters
serializerISerializer instance to use for serialization
Returns
boolean true for success, false for serialization failure

◆ SetPacketFlags()

void AzNetworking::UdpPacketHeader::SetPacketFlags ( PacketFlagBitset  flags)
inline

Sets the packet flag bitset for this packet.

Parameters
flagsThe packet flag bitset

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