43 [[nodiscard]]
virtual const std::vector<uint8_t> &
getData()
const = 0;
49 [[nodiscard]]
virtual size_t getSize()
const = 0;
55 [[nodiscard]]
virtual uint32_t
getFlags()
const = 0;
61 virtual void setData(
const std::vector<uint8_t> &data) = 0;
PacketFlag
Flags that control packet behavior and delivery guarantees.
@ SENT
Flag indicating packet has been sent from peer.
@ UNSEQUENCED
Packet will not be sequenced with other packets.
@ NO_ALLOCATE
Packet will not allocate data, and user must supply it.
@ RELIABLE
Packet must be received by the target peer and resent if dropped.
@ UNRELIABLE_FRAGMENT
Packet will be fragmented using unreliable (default) sends.
Interface representing a network packet.
virtual size_t getSize() const =0
Get the size of the packet data in bytes.
virtual uint32_t getFlags() const =0
Get the flags associated with this packet.
virtual void setData(const std::vector< uint8_t > &data)=0
Set new data for this packet.
virtual ~IPacket()=default
virtual const std::vector< uint8_t > & getData() const =0
Get the packet data as a byte buffer.