public function onFinish() { if ($this->attachedServer) { $this->attachedServer->attachedClients->detach($this); } Timer::remove($this->keepaliveTimer); parent::onFinish(); }