Hi,
I'm using CURL to connect to multiple xml feeds and process them when the page loads. Unfortunately, every once in awhile a page won't be responsive and my script will stall as well. Here's an example of the code that I'm working with. I set the timeout to 1 but that doesn't appear to be working. I then set the timeout to 0.0001 just to test things today and it still pulled in xml feeds. Do you guys have any ideas on how to force curl to timeout when a script is taking forever.
foreach($urls as $k => $v) {
$curl[$k] = curl_init();
curl_setopt($curl[$k], CURLOPT_URL, $v);
curl_setopt($curl[$k], CURLOPT_RETURNTRANSFER, true);
curl_setopt($curl[$k], CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($curl[$k],CURLOPT_CONNECTTIMEOUT, 1);
Thanks!
Russ