Code Monkey home page Code Monkey logo

telnetclient.php's People

Contributors

austp avatar diotteo avatar frittenkeez avatar ngharo avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

telnetclient.php's Issues

Using PHP 7.3 cause a error on line 741

Its about the function count().

If made this change, its fine to go:

} while ($is_get_more_data || call_user_func_array($get_more_data_cb, array((is_countable($data) && count($data)), $c, &$userData)));

But PHP < 7, doesnt have this funcion is_countable().

And i use this on top of the class:

if (!function_exists('is_countable')) {
function is_countable($var) {
return (is_array($var) || $var instanceof Countable);
}
}

Any ideas ?

Great Work ;)

ask

hello sir
how to fix timed out?
timed out because lots of data array on my device but if the data is little its working

login failed

I use this package but when running, the error 'Login Failed' appears.

sendCommand and exec with diferent Prompts doesnt Work!?

The Server have 3 steps for this command:

Login Prompt is OK!

1 cmd
epon>enable

2 cmd
epon#configure terminal

3 cmd
epon(config)#show onu-status

Gives alway timed out!

Sample code:

$prompt = "epon>";

$telnet = new TelnetClient($OLT_REMOTE_IP, $OLT_TCP_PORT);
$telnet->connect();
$telnet->setPrompt($prompt); //setRegexPrompt() to use a regex

$telnet->setPruneCtrlSeq(true); //Enable this to filter out ANSI control/escape sequences

$telnet->login($username, $password, $loginPrompt, $passPrompt);

$telnet->sendCommand('enable');	
sleep(1);	
$telnet->sendCommand('configure terminal');	
sleep(1);	
$telnet->sendCommand('show onu-status');

	do {
		$line = $telnet->getLine($matchesPrompt);
		//print($line).'@<br>';
		$linha .= $line;			
	} while (!$matchesPrompt);

Stops with timed out. Any help ?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.