public function handleError(\Exception $error) { $this->emit('error', array(new \RuntimeException("An error occurred in the underlying stream", 0, $error), $this)); $this->close($error); }