private function ReadData() { $Packet = array(); $Size = FRead($this->Socket, 4); $Size = UnPack('V1Size', $Size); $Size = $Size['Size']; $Packet = FRead($this->Socket, $Size); $Packet = UnPack('V1RequestId/V1Response/a*String/a*String2', $Packet); return $Packet; }
/** * Get unsigned long from buffer * * @return int */ public function GetUnsignedLong() { $Data = UnPack('V', $this->Get(4)); return $Data[1]; }
/** * Get unsigned long from buffer * * @return int */ public function GetUnsignedLong() { if ($this->Remaining() < 4) { throw new InvalidPacketException('Not enough data to unpack an usigned long.', InvalidPacketException::BUFFER_EMPTY); } $Data = UnPack('V', $this->Get(4)); return $Data[1]; }