Beispiel #1
0
 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();
 }
Beispiel #2
0
 public function __destruct()
 {
     if (!$this->socket) {
         return;
     }
     $this->socket->close();
 }
Beispiel #3
0
 /**
  * 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);
 }
Beispiel #4
0
 public function shutdown()
 {
     $this->loop->removeReadStream($this->socket->getResource());
     $this->socket->shutdown();
     $this->socket->close();
 }