FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » Imported messages » comp.lang.php » getting a url with a mS timout in PHP < 5.2
Show: Today's Messages :: Polls :: Message Navigator
Switch to threaded view of this topic Create a new topic Submit Reply
getting a url with a mS timout in PHP < 5.2 [message #175773] Sun, 23 October 2011 21:56 Go to next message
Ben Barker is currently offline  Ben Barker
Messages: 5
Registered: October 2011
Karma: 0
Junior Member
Can anyone suggest an approach to getting a file from a URL, with a
timeout in the mS range, given that I am using php 5.1, and the cURL
mS timeout option did not becomeavailable until 5.2?

I have looked at using file_get contents, but whatever I try I don't
seem to be able to get the timeout below 1s. Quite a number of the
URLs I'm likely to try will be unavailable, but those that return
should do so very quickly indeed - so for the script to run as fast as
possibly I ideally need to find a way around this...

Cheers,

Ben
Re: getting a url with a mS timout in PHP < 5.2 [message #175776 is a reply to message #175773] Sun, 23 October 2011 23:35 Go to previous messageGo to next message
Jerry Stuckle is currently offline  Jerry Stuckle
Messages: 2598
Registered: September 2010
Karma: 0
Senior Member
On 10/23/2011 5:56 PM, Ben Barker wrote:
> Can anyone suggest an approach to getting a file from a URL, with a
> timeout in the mS range, given that I am using php 5.1, and the cURL
> mS timeout option did not becomeavailable until 5.2?
>
> I have looked at using file_get contents, but whatever I try I don't
> seem to be able to get the timeout below 1s. Quite a number of the
> URLs I'm likely to try will be unavailable, but those that return
> should do so very quickly indeed - so for the script to run as fast as
> possibly I ideally need to find a way around this...
>
> Cheers,
>
> Ben
>

1. Update your version of PHP.
2. Never expect ms response times consistently from a site. Too many
things can affect the response time.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex(at)attglobal(dot)net
==================
Re: getting a url with a mS timout in PHP < 5.2 [message #175780 is a reply to message #175776] Mon, 24 October 2011 06:42 Go to previous message
Ben Barker is currently offline  Ben Barker
Messages: 5
Registered: October 2011
Karma: 0
Junior Member
On Oct 24, 12:35 am, Jerry Stuckle <jstuck...@attglobal.net> wrote:
> On 10/23/2011 5:56 PM, Ben Barker wrote:
>
>> Can anyone suggest an approach to getting a file from a URL, with a
>> timeout in the mS range, given that I am using php 5.1, and the cURL
>> mS timeout option did not becomeavailable until 5.2?
>
>> I have looked at using file_get contents, but whatever I try I don't
>> seem to  be able to get the timeout below 1s. Quite a number of the
>> URLs I'm likely to try will be unavailable, but those that return
>> should do so very quickly indeed - so for the script to run as fast as
>> possibly I ideally need to find a way around this...
>
>> Cheers,
>
>> Ben
>
> 1. Update your version of PHP.
> 2. Never expect ms response times consistently from a site.  Too many
> things can affect the response time.
>
> --
> ==================
> Remove the "x" from my email address
> Jerry Stuckle
> JDS Computer Training Corp.
> jstuck...@attglobal.net
> ==================

Unfortunately I can't easily update the PHP version - though that may
end up being the solution. However, in this case mS response times are
reasonable, since this is a local network with well defined traffic
volumes.

Cheers,

Ben
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Giveaway: CodeLobster PHP IDE Professional edition
Next Topic: Using PHP Tags in eval()
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Fri Sep 20 13:38:59 GMT 2024

Total time taken to generate the page: 0.02633 seconds