• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Telnet and control characters

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.

telnet 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.

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

Any ideas?

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  

  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2021 MyBB Group.