public function sendFrame($data, $type = 0x0, $cb = null) { if ($this->finished) { return false; } $this->framesBuffer[] = $data; if ($cb !== null) { $this->onWrite->push($cb); } $this->flush(); return true; }