curl-and-php
Re: Do not wait after a curl post to a site.
Date: Tue, 19 Jul 2005 08:37:58 -0600
Thanks. Kirk Well, I guess it is not a bottleneck the server, is just that
curl waits for an answer, The normal process via the carrier webform takes
aprox 20 sec to 30 sec per message... so I think time is normal, but.. take
in account aprox. 60 curl post and takes aprox. 5 minutes. I will see how it
can be speedup, or how to make the curl from the server and not from the
webpage ??
Norman
On 7/19/05, Kirk Hedden <khedden_at_treefrogcreations.com> wrote:
>
> There's not a way to do this, as far as I know.
>
> If you don't care about responses, you can just open a raw socket and send
> the data you need. Of course, this might not solve the issue if the server
> is the bottleneck.
>
> Alternatively, you may also want to contact your carriers and see if they
> have some kind of better system for submitting text messages for automated
> systems like yours.
>
> Kirk
>
> At 06:47 PM 7/18/2005, you wrote:
>
> Hi. I am a volunteer to the Guatemala Red Cross, we want to use our
> personal cellphones to be advise of any situation easier and faster.
> I worked in a small webform that curl-post to the different Cellphone
> carriers to send a SMS, currently there are 60 phones on the list, I see
> that the response is aprox. 5 minutes, after the submit.
>
> How can i make libcurl to ignore to wait and do the post for the next
> phone in list? in order to have a faster response from the submit form...?
> right now this is what I have...
>
> (for 2 different carriers)
>
> //Telefónica
> $curlPost = 'to=' . urlencode($phoneNumber) . '&subject=' .
> urlencode($from) . '&text=' . urlencode($message) . '&submit=Enviar';
> $ch = curl_init();
> curl_setopt($ch, CURLOPT_URL, 'http://216.184.96.114/sms/mensaje.php')<http://216.184.96.114/sms/mensaje.php%27%29>
> ;
> curl_setopt($ch, CURLOPT_HEADER, 1);
> curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
> curl_setopt($ch, CURLOPT_POST, 1);
> curl_setopt($ch, CURLOPT_POSTFIELDS, $curlPost);
> curl_exec ($ch);
> curl_close ($ch);
>
> //PCS
> $curlPost = 'telefono=' . urlencode($phoneNumber) . '&nombre=' .
> urlencode($from) . '&msg=' . urlencode($message) . '&B1=E n v i a r&B2=B o r
> r a r';
> $ch = curl_init();
> curl_setopt($ch, CURLOPT_URL, '
> http://was.intelnet.net.gt/cgi-bin/sms.cgi')<http://was.intelnet.net.gt/cgi-bin/sms.cgi%27%29>
> ;
> curl_setopt($ch, CURLOPT_REFERER, '
> http://www.pcsdigital.com.gt/mensajes.html')<http://www.pcsdigital.com.gt/mensajes.html%27%29>
> ;
> curl_setopt($ch, CURLOPT_HEADER, 1);
> curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
> curl_setopt($ch, CURLOPT_POST, 1);
> curl_setopt($ch, CURLOPT_POSTFIELDS, $curlPost);
> curl_exec ($ch);
> curl_close ($ch);
>
>
>
> Thanks
>
>
Received on 2005-07-19