public function close() { if (!$this->writable && !$this->closing) { return; } $this->closing = false; $this->readable = false; $this->writable = false; $this->emit('end', array($this)); $this->emit('close', array($this)); $this->pause(); $this->buffer->close(); $this->socket->shutdown(); $this->socket->close(); $this->removeAllListeners(); }
public function shutdown() { $this->loop->removeReadStream($this->socket->getResource()); $this->socket->shutdown(); $this->socket->close(); }