public function __construct($socket, $url, $encoding) { parent::__construct(); $this->url = $url; $this->encoding = $encoding; $this->sent = $socket->getSent(); $this->content = false; $raw = $this->readAll($socket); if ($socket->isError()) { $this->setError('Error reading socket [' . $socket->getError() . ']'); return; } $this->parse($raw); }