示例#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();
 }
示例#2
0
 public function shutdown()
 {
     $this->loop->removeReadStream($this->socket->getResource());
     $this->socket->shutdown();
     $this->socket->close();
 }