public function getOutputOf($cmd, $newline = true, $maxtimeout = 10) {
        $return = array();
        $this->recvAll();
        $this->send($cmd, $newline);
        $timestart = time();
        while (true) {
            $buff = $this->recvLine();
            $timerun = time() - $timestart;

            if (strpos($buff, $this->prompt) !== false) {
                break;
            }
            if (preg_match("/$this->page_delimiter/i", $buff)) {
                $this->send(" ", false);
                $timestart = time();
                continue;
            }

            if ($timerun >= $maxtimeout) {
                throw new TelnetException("Timeout reached while waiting to execute command: [ $cmd ]");
            }
            $return[] = $buff;
        }

        $newret = array_slice($return, 1, -1);
        $newret = implode("\r", $newret);
        return $newret;
    }