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::TcpPacketHeader Class Referencefinal

packet header class. More...

#include <TcpPacketHeader.h>

Inherits AzNetworking::IPacketHeader.

Public Member Functions

 AZ_RTTI (TcpPacketHeader, "{6D92B9BE-C5E4-4571-B0FA-8F29042BE93B}", IPacketHeader)
 
 TcpPacketHeader (PacketType packetType, uint16_t packetSize)
 
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.
 
uint16_t GetPacketSize () const
 
bool Serialize (ISerializer &serializer)
 
- Public Member Functions inherited from AzNetworking::IPacketHeader
 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

packet header class.

Constructor & Destructor Documentation

◆ TcpPacketHeader()

AzNetworking::TcpPacketHeader::TcpPacketHeader ( PacketType  packetType,
uint16_t  packetSize 
)
inline

Construct with a packet type and size.

Parameters
packetTypetype of packet
packetSizesize of the packet in bytes, not including header size

Member Function Documentation

◆ GetPacketId()

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

Returns the packet id.

Returns
PacketId

Implements AzNetworking::IPacketHeader.

◆ GetPacketSize()

uint16_t AzNetworking::TcpPacketHeader::GetPacketSize ( ) const
inline

Gets the size of the packet being received.

Returns
size of the packet in bytes, not including header size

◆ GetPacketType()

PacketType AzNetworking::TcpPacketHeader::GetPacketType ( ) const
inlineoverridevirtual

◆ IsPacketFlagSet()

bool AzNetworking::TcpPacketHeader::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::TcpPacketHeader::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

◆ SetPacketFlag()

void AzNetworking::TcpPacketHeader::SetPacketFlag ( PacketFlag  flag,
bool  value 
)
inlineoverridevirtual

Sets the specified packet flag for this packet.

Implements AzNetworking::IPacketHeader.


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