/** * @inheritdoc */ public function close() : self { if (false === $this->isReadable() && false === $this->closing) { return $this; } $this->closing = false; $this->readable = false; $this->writable = false; $this->emit('end', [$this]); $this->emit('close', [$this]); $this->loop->removeStream($this->stream); $this->buffer->removeListeners(); $this->removeListeners(); $this->handleClose(); return $this; }
public function shutdown() { $this->loop->removeStream($this->socket); fclose($this->socket); $this->removeListeners(); }