public function decode() { parent::decode(); $this->seqNumber = $this->getLTriad(); while (!$this->feof()) { $offset = 0; $packet = EncapsulatedPacket::fromBinary(substr($this->buffer, $this->offset), false, $offset); $this->offset += $offset; if (strlen($packet->buffer) === 0) { break; } $this->packets[] = $packet; } }
public function decode() { parent::decode(); $this->seqNumber = unpack("V", $this->get(3) . "")[1]; while (!$this->feof()) { $offset = 0; $data = substr($this->buffer, $this->offset); $packet = EncapsulatedPacket::fromBinary($data, false, $offset); $this->offset += $offset; if (strlen($packet->buffer) === 0) { break; } $this->packets[] = $packet; } }