Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

What I do wrong? #30

Open
Mackiavelly opened this issue Jul 15, 2020 · 0 comments
Open

What I do wrong? #30

Mackiavelly opened this issue Jul 15, 2020 · 0 comments

Comments

@Mackiavelly
Copy link

$telnet = \Graze\TelnetClient\TelnetClient::factory();
$telnet->connect('ip:23', 'User name:');
$resp = $telnet->execute('admin', 'User password:');

what wrong???

Graze\TelnetClient\Exception\UndefinedCommandException
1. in /vendor/graze/telnet-client/src/InterpretAsCommand.phpat line 89
808182838485868788899091 
            if (in_array($command, [$this->WILL, $this->WONT])) {
                $socket->write($this->IAC . $this->DONT . $option);
                return true;
            }
        } catch (Exception $e) {
            throw new TelnetException('failed negotiating IAC', 0, $e);
        }
 
        throw new UndefinedCommandException($command);
    }
}
2. in /vendor/graze/telnet-client/src/TelnetClient.php at line 240– Graze\TelnetClient\InterpretAsCommand::interpret('', Socket\Raw\Socket)
234235236237238239240241242243244245246            }
 
            if (in_array($character, [$this->NULL, $this->DC1])) {
                break;
            }
 
            if ($this->interpretAsCommand->interpret($character, $this->socket)) {
                continue;
            }
 
            $buffer .= $character;
 
            // check for prompt
3. in /vendor/graze/telnet-client/src/TelnetClient.php at line 199– Graze\TelnetClient\TelnetClient::getResponse('User password:', null)
193194195196197198199200201202203204205    {
        if (!$this->socket) {
            throw new TelnetException('attempt to execute without a connection - call connect first');
        }
 
        $this->write($command);
        return $this->getResponse($prompt, $promptError);
    }
 
    /**
     * @param string $command
     *
     * @return void
4. in /index.php at line 170– Graze\TelnetClient\TelnetClient::execute('admin', 'User password:')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant