/** * {@inheritdoc} */ public function unreference(SocketEventInterface $socket) { $id = (int) $socket->getResource(); if (isset($this->events[$id]) && $socket === $this->events[$id]->data) { $this->unreferenced[$id] = $socket; } }
/** * {@inheritdoc} */ public function isFreed(SocketEventInterface $socket) : bool { $id = (int) $socket->getResource(); return !isset($this->sockets[$id]) || $socket !== $this->sockets[$id]; }