public function sendChunk($req, $chunk) { $packet = "" . "" . pack('nn', $req->attrs->id, mb_orig_strlen($chunk)) . "" . ""; // reserved return $this->write($packet) && $this->write($chunk); // content }