PacketSequencer
in package
Table of Contents
Properties
- $counter : int
- $start : SequenceStart
- A class for generating packet sequences.
Methods
- __construct() : mixed
- Constructs a new PacketSequencer with the provided SequenceStart.
- nextSequence() : int
- Returns the next sequence value, updating the sequence counter in the process.
- setSequenceStart() : void
- Sets the sequence start, also known as the "starting counter ID".
Properties
$counter
private
int
$counter
$start
A class for generating packet sequences.
private
SequenceStart
$start
The start of the sequence.
Methods
__construct()
Constructs a new PacketSequencer with the provided SequenceStart.
public
__construct(SequenceStart $start) : mixed
Parameters
- $start : SequenceStart
-
The sequence start.
nextSequence()
Returns the next sequence value, updating the sequence counter in the process.
public
nextSequence() : int
Note: This is not a monotonic operation. The sequence counter increases from 0 to 9 before looping back around to 0.
Return values
int —The next sequence value.
setSequenceStart()
Sets the sequence start, also known as the "starting counter ID".
public
setSequenceStart(SequenceStart $start) : void
Note: This does not reset the sequence counter.
Parameters
- $start : SequenceStart
-
The new sequence start.