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 __destruct() { if (!$this->socket) { return; } $this->socket->close(); }
/** * A wrapper to cleanly read a response from clamd * * @return string */ private function _receiveResponse() { $result = $this->socket->read(4096); $this->socket->close(); return trim($result); }
public function shutdown() { $this->loop->removeReadStream($this->socket->getResource()); $this->socket->shutdown(); $this->socket->close(); }