public function sendPacket($pct, $cb = null)
{
if (sizeof($this->framesBuffer)) {
$this->buffer[] = 'a' . $this->toJson($this->framesBuffer);
$this->framesBuffer = [];
}
$this->buffer[] = $pct;
if ($cb !== null) {
$this->onWrite->push($cb);
}
$this->flush();
}