public function pause() { if (!$this->paused) { $this->paused = true; if (isset($this->loop)) { $this->loop->removeReadStream($this->socket); } } }