public function reply_json($req, $data) { $this->send($req->sender, $req->conn_id, json_encode($data)); }