예제 #1
0
 /**
  * @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;
 }
예제 #2
0
 public function shutdown()
 {
     $this->loop->removeStream($this->socket);
     fclose($this->socket);
     $this->removeListeners();
 }