private function readBytes($bytes, $noBuffer)
    {
        if(!$this->socket) {
            return "";
        }

        if($noBuffer) {
            return fread($this->socket, $bytes);
        }

        $bytes_left = $bytes;
        $retval = "";
        while( !feof($this->socket) && $bytes_left > 0 ) {
            $res = fread($this->socket, $bytes_left);
            $retval.=$res;
            $bytes_left-=strlen($res);
        }

        return $retval;
    }