[Q] Blocked in fread()
| From: | glory | Date: | Tue, 14 May 2002 01:32:36 +0000 |
| Subject: | [Q] Blocked in fread() | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-84022@lists.php.net to get a copy of this message | ||
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);
}
fclose($fp);
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
different.
What's wrong?
Plz, help me.
.