note 82870 deleted from function.stream-get-contents by cmb
| From: | cmb@php.net | Date: | Wed, 08 Apr 2020 09:27:45 +0000 |
| Subject: | note 82870 deleted from function.stream-get-contents by cmb | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-214433@lists.php.net to get a copy of this message | ||
Note Submitter: finalmau at gmail dot com
----
some times this functions cause an max execution time time error, Why?
Simple, if you use it the function wait for have the specified byte length into the resource or the
end of file, but, several times this not happend, so we need implement an artificial flag like this:
$tmp = stream_get_contents($this->socket, 42);
while($tmp[42] != 'N'){
//Your code...
$tmp = stream_get_contents($this->socket, 42);
}