Welcome Guest, Not a member yet? Register   Sign In
Telnet and control characters
#1

[eluser]dsloan[/eluser]
This isn't directly related to CodeIgniter, but forms part of my CI application.
A Windows application running on the same box as the application can be accessed via telnet, and a string containing control characters sent to it to retrieve data. This is working fine when I perform the access from a command prompt - e.g.

Code:
telnet 192.168.1.10 3002
Ctrl-B P P Ctrl-C

How do I send the same string via my php application?

My code can establish the connection ok, but I don't know how to construct the string.

Code:
$fp = fsockopen ($host, $port, $errnum, $errstr, $timeout);
if (!is_resource($fp)) {
    exit("connection fail: ".$errnum." ".$errstr) ;
} else {
    // $message = ""; ???
    $result = fwrite($fp, $out);
}

Any ideas?




Theme © iAndrew 2016 - Forum software by © MyBB