How to run cURL once, checking domain availability in a loop? Help fixing code please?

Link text I think you're after the callback options documented. For example --> CURLOPT_SEEKFUNCTION.

Up vote 0 down vote favorite share g+ share fb share tw.

What I have in place, is a domain availability check, which connects up to an API and outputs "Available: and Unavailable:" from $tmp. Ths below code will only check the availability ONCE. I would like to check the availability of the domain, multiple times (possibly on a loop?

), without having to run restart cURL connection everytime (as it wastes time). I just don't know how I can connect to cURL once and run the loop (doing the check through the API). Help adjusting the code would be very much appreciated!

Thank you. Current code *>/i', '', $tmp); $tmp = explode('', $tmp); echo $tmp0; echo ""; echo $tmp1; echo ""; return $tmp; } $returnUrl = "mysite.com. Au/check.

Php"; $url = "https://www.apisite.com. Au/availability/check. Php?

Domain=testdomain&suffixes=.com. Au"; $output = GetCurlPage("$url");? > php javascript php5 curl performance link|improve this question edited Dec 19 '10 at 14:30 asked Dec 19 '10 at 6:51iCeR374 60% accept rate.

Really not sure if I get your problem correctly. But there is no " connecting once to cURL ". Curl is an API for making requests (HTTP being a side job).

It retrieves one page per request. There is no persistent connection or constant data flow (unless WebSocket supported) to be reused for multiple requests. – mario Dec 19 '10 at 7:28 Ok so the problem is this; I need the above script to check the availability of the domain specificed in $url ($domain+$suffixes), multiple times, ie: in a loop.

I can run the bottom of the script (outside of the cURL function) in a loop, but if I do that, curl is initialized and executed all over again. This wastes 300ms to 1s between availability checks. What can I do to reduce the time in execution of a loop and where can the loop be placed?

Hope this helps, sorry. Thanks! – iCeR Dec 19 '10 at 13:01.

Link textI think you're after the callback options documented. For example --> CURLOPT_SEEKFUNCTION.

No idea how to use it, sorry. Please see my comment above in response to @mario. – iCeR Dec 19 '10 at 13:03 Question updated.

Code minimized. – iCeR Dec 19 '10 at 14:30.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions