protected function assertPacketFlags($value, $fromPacket = true)
    {
        if ($this->packetFlags !== $value) {
            $this->throwException(
                sprintf(
                    'Expected flags %02x but got %02x.',
                    $value,
                    $this->packetFlags
                ),
                $fromPacket
            );
        }
    }