protected function readRaw($length)
    {
        $data = '';
        $dataLeft = $length;
        do {
            $data .= $this->socket->read($dataLeft);
            $dataLeft = $length - strlen($data);
        } while ($dataLeft > 0);
        return $data;
    }