Get all in-use packet IDs (for session persistence).
Check if a packet ID is currently in use.
The packet ID to check
true if the ID is in use
Release a packet ID for reuse.
The packet ID to release
Reset the allocator, releasing all IDs.
Restore in-use IDs (for session restoration).
Set of packet IDs to mark as in-use
Allocates and recycles packet identifiers.
Uses sequential allocation with wraparound at 65535. Freed IDs are immediately available for reuse. When all IDs are exhausted, throws PacketIdExhaustedError (should not happen with proper flow control).
Example