note 21455 rejected from function.fread by torben
| From: | torben@php.net | Date: | Tue, 14 May 2002 01:15:04 +0000 |
| Subject: | note 21455 rejected from function.fread by torben | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-30607@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.
.