Go Back   CodingForums.com > :: Server side development > PHP

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 11-05-2009, 03:40 PM   PM User | #1
kristallaju
New to the CF scene

 
Join Date: Sep 2009
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
kristallaju is an unknown quantity at this point
Curl timeout breaks script

So im having difficulties with skipping timeout error in curl
my script calls different functions my problem is lets say if in function2 is curl timeout error it wont continue with function3 but kills entire script. Is there any way to skip function2 (if there is timeout error) and continue with function3

PHP Code:
// Start calling functions

   
function1();
   
function2();
   
function3();
   
function4();
   
function5(); 
kristallaju is offline   Reply With Quote
Old 11-05-2009, 04:54 PM   PM User | #2
oesxyl
Master Coder


 
Join Date: Dec 2007
Posts: 6,682
Thanks: 436
Thanked 890 Times in 879 Posts
oesxyl is a jewel in the roughoesxyl is a jewel in the roughoesxyl is a jewel in the rough
you can control timeout, see the manual for curl_setopt, CURLOPT_TIMEOUT

http://www.php.net/manual/en/function.curl-setopt.php

you can use the return value to control the flow, see the manual for curl_exec, return values, for the rest of the question.

http://www.php.net/manual/en/function.curl-exec.php

best regards
oesxyl is offline   Reply With Quote
Reply

Bookmarks

Tags
curl, timeout

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 06:19 AM.


Advertisement
Log in to turn off these ads.