graze / graze/telnet-client

What I do wrong?

Open
#30 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
PHP
Stars
48
Forks
10
PR merge metrics
No merged PRs in 30d

Description

$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:')
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.