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. | |
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.
|
pure virtual |
Returns the packet id.
Implemented in AzNetworking::TcpPacketHeader, and AzNetworking::UdpPacketHeader.
|
pure virtual |
Returns the packet type.
Implemented in AzNetworking::TcpPacketHeader, and AzNetworking::UdpPacketHeader.
|
pure virtual |
Returns if the specified packet flag is set for this packet.
Implemented in AzNetworking::TcpPacketHeader, and AzNetworking::UdpPacketHeader.
|
pure virtual |
Sets the specified packet flag for this packet.
Implemented in AzNetworking::TcpPacketHeader, and AzNetworking::UdpPacketHeader.