|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2010-01-13 09:58 UTC] jason at lentink dot net
Description: ------------ When using stream_set_blocking on a stream will create a huge load on cpu. When using this function it uses up to 50% of the cpu. When not using this function it will only use 0.1% cpu usage. Reproduce code: --------------- $this->_socket = fsockopen($str, $port, $errno, $errstr); stream_set_blocking($this->_socket, 0); // non blocking Expected result: ---------------- An socket which will be opened fast. in a non-blocking mode. Actual result: -------------- An open socket. But the cpu use is enormous. PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Mon Oct 27 07:00:01 2025 UTC |
Then we go back to the first post and there is a 2 line example of the problem. Reproduce code: --------------- <?php $socket = fsockopen("somehost", 631313, $errno, $errstr); stream_set_blocking($socket, 0); // non blocking this is enough to trigger the problem. I hope this is short enough.