I tried to write PHP code interacting with Windows-based application.

function send_recv($ip, $port, $timeout, $QUERY)
  $fp = fsockopen($ip, $port, $errno, $errstr, $timeout);

  if (!$fp) return NULL;

  fputs($fp, $QUERY);
  $REPLY = fread($fp, 128);
  while (!feof($fp)) {
    $REPLY. = fread($fp, 128);

  return $REPLY;

My problem is that the above code is blocked in fread().
Of course, I tried to use fgets(), fpassthru(), etc. But nothing was

What's wrong?
Plz, help me.


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

Reply via email to