protected function close() { if ($this->socket) { if (!Server::$server->taskworker) { swoole_event_del($this->socket); } @fclose($this->socket); $this->socket = null; } # 重置任务列表 $this->taskCallbackList = []; }