Open 3D Engine AzNetworking API Reference 23.10.0
O3DE is an open-source, fully-featured, high-fidelity, modular 3D engine for building games and simulations, available to every industry.
AzNetworking::IPacketHeader Class Referenceabstract

A packet header that lets us deduce packet type for any incoming packet. More...

#include <IPacketHeader.h>

Inherited by AzNetworking::TcpPacketHeader, and AzNetworking::UdpPacketHeader.

Public Member Functions

 AZ_TYPE_INFO (IPacketHeader, "{90A0EFE3-01A4-4F04-87CF-E98E94D49648}")
 
virtual PacketType GetPacketType () const =0
 
virtual PacketId GetPacketId () const =0
 
virtual bool IsPacketFlagSet (PacketFlag flag) const =0
 
virtual void SetPacketFlag (PacketFlag flag, bool value)=0
 Sets the specified packet flag for this packet.
 

Detailed Description

A packet header that lets us deduce packet type for any incoming packet.

IPacketHeader defines an abstract interface for a descriptor of all AzNetworking::IPacket sent through AzNetworking. The PacketHeader is used to identify and describe the contents of a Packet so that transport logic can identify what additional processing steps need to be taken (if any) and what type of Packet is being inspected.

The PacketFlags portion of the header represents the first byte of the header. While it can be encrypted it is otherwise not exposed to additional processing (such as an AzNetworking::ICompressor). PacketFlags are a bitfield use to provide up front information about the state of the packet. Currently there is only one flag to indicate if the Packet is compressed or not.

The remainder of the header contains the PacketType and the PacketId. While the PacketFlags byte is exempt from most additional forms of processing, the remainder of the header is not.

Member Function Documentation

◆ GetPacketId()

virtual PacketId AzNetworking::IPacketHeader::GetPacketId ( ) const
pure virtual

Returns the packet id.

Returns
PacketId

Implemented in AzNetworking::TcpPacketHeader, and AzNetworking::UdpPacketHeader.

◆ GetPacketType()

virtual PacketType AzNetworking::IPacketHeader::GetPacketType ( ) const
pure virtual

Returns the packet type.

Returns
packet type

Implemented in AzNetworking::TcpPacketHeader, and AzNetworking::UdpPacketHeader.

◆ IsPacketFlagSet()

virtual bool AzNetworking::IPacketHeader::IsPacketFlagSet ( PacketFlag  flag) const
pure virtual

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

Returns
true if the flag is set for this packet

Implemented in AzNetworking::TcpPacketHeader, and AzNetworking::UdpPacketHeader.

◆ SetPacketFlag()

virtual void AzNetworking::IPacketHeader::SetPacketFlag ( PacketFlag  flag,
bool  value 
)
pure virtual

Sets the specified packet flag for this packet.

Implemented in AzNetworking::TcpPacketHeader, and AzNetworking::UdpPacketHeader.


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