note 85717 added to function.curl-multi-exec

From: Date: Sat, 13 Sep 2008 18:56:52 +0000
Subject: note 85717 added to function.curl-multi-exec
Groups: php.notes 
Request: Send a blank email to php-notes+get-144401@lists.php.net to get a copy of this message
> replying to viczbk.ru Just sharing my attempt at it. > while (($res = curl_multi_select($mh)) === 0) {}; This worked on my windows computer (php 5.2.5) but when I ran the curl program in my new centOS server (php 5.1.6) the function never updates unless curl_multi_exec() is added to the loop, taking away the point of using it to save cycles. curl_multi_select() also allows you to set a timeout but it doesn't seem to help, then again, don't see why people wouldn't use it anyway. Even when curl_multi_select($mh) does work there's no way to know which of the sockets updated in status or if they've received partial data, completely finished, or just timed out. It's not reliable if you want to remove / add data as soon as things finish. Try calling just example.com or some other website with very little data. curl_multi_select($mh) can send non 0 value a couple of thousand times before finishing. Lazily adding a usleep(25000) or some minimal amount can also help not waste cycles. ---- Server IP: 209.41.74.194 Probable Submitter: 76.203.160.119 ---- Manual Page -- http://www.php.net/manual/en/function.curl-multi-exec.php Edit -- https://master.php.net/note/edit/85717 Del: integrated -- https://master.php.net/note/delete/85717/integrated Del: useless -- https://master.php.net/note/delete/85717/useless Del: bad code -- https://master.php.net/note/delete/85717/bad+code Del: spam -- https://master.php.net/note/delete/85717/spam Del: non-english -- https://master.php.net/note/delete/85717/non-english Del: in docs -- https://master.php.net/note/delete/85717/in+docs Del: other reasons-- https://master.php.net/note/delete/85717 Reject -- https://master.php.net/note/reject/85717 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#144401) next »