Code:
function _Write($cmd, $s1='', $s2='') {
// Get and increment the packet id
$id = ++$this->_Id;
// Put our packet together
$data = pack("VV",$id,$cmd).$s1.chr(0).$s2.chr(0);
echo $data;
// Prefix the packet size
$data = pack("V",strlen($data)).$data;
echo "
".$data;
// Send packet
fwrite($this->_Sock,$data,strlen($data));
// In case we want it later we'll return the packet id
return $id;
}
Was passiert hier genau? besonders das pack versteh ich nicht.
Edit: die echos sind von mir^^
Daniel S.