note 90606 modified in function.socket-read by danbrown
| From: | danbrown@php.net | Date: | Thu, 30 Apr 2009 15:23:07 +0000 |
| Subject: | note 90606 modified in function.socket-read by danbrown | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-154046@lists.php.net to get a copy of this message | ||
Here is a quick example of how to use socket_read to receive data until the connection is
terminated.
I've found this useful when I need to manually retrieve replies to XML-RPC queries.
<?php
$reply = "";
do {
$recv = "";
$recv = socket_read($socket, '1400');
if($recv != "") {
$reply .= $recv;
}
} while($recv != "");
echo($reply);
?>
--was--
Here is a quick example of how to use socket_read to receive data until the connection is
terminated.
I've found this useful when I need to manually retrieve replies to XML-RPC queries.
$reply = "";
do {
$recv = "";
$recv = socket_read($socket, '1400');
if($recv != "") {
$reply .= $recv;
}
} while($recv != "");
echo($reply);
http://php.net/manual/en/function.socket-read.php