public function on_data($data) { // callback if ($this->recv_cb) { call_user_func($this->recv_cb, $data); } }