I'm trying to write a simple PHP script that communicates with a daemon
running on the same server.

Basically, the daemon just accepts an integer and returns an integer:

[josh@jlevine-research josh]$ telnet 60324
Connected to localhost.
Escape character is '^]'.
25Connection closed by foreign host.

When I try doing this with PHP, however, the output is 2[]5 (where [] ==
a small square symbol).

Here is the script:

$fp = fsockopen("", 60324, $errno, $errstr);
if (!$fp) {
    echo "ERROR: $errno - $errstr<br>\n";
} else {
    socket_set_blocking ($fp, 1);
    socket_set_timeout($fp, 200);
    $return = fread($fp,4);
    echo $return;

I've tried various string format and type-casting functions with no
results (usually just returns nothing after formatted).

Any ideas?

Thanks in advance,
Josh Levine

PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to