RE: [PHP] Timing out fopen using https stream wrapper?

2003-07-05 Thread Giz
Thanks for the reply,
  Well hopefully this will help narrow down the issue.  With Fsockopen a
timeout can be passed, however, this is using fopen.  I am hoping there may
be some obscure way of setting a timeout but so far, I've not been able to
find one.

-Original Message-
From: Dan Anderson [mailto:[EMAIL PROTECTED] 
Sent: Saturday, July 05, 2003 6:26 PM
To: Giz
Cc: [EMAIL PROTECTED]
Subject: RE: [PHP] Timing out fopen using https stream wrapper?

>From the user comments:
I think it might be useful to point out that set_time_limit() doesn't
have any effect on stream operations. A stalled script, either during
open operations (e.g. fsockopen()) or read operations (e.g. fgets()),
can make your script run "forever".

So it would be advisable to define timeouts for opening sockets (with
the timeout parameter in fsockopen()) and for reading data from sockets
(with socket_set_timeout()).

So, yes, you would have had to go to:
http://us3.php.net/manual/en/function.fsockopen.php

Sorry about that but I didn't exactly have lots of time on my hands at
the time to give you more details.

-Dan

On Sat, 2003-07-05 at 21:27, Giz wrote:
> I've looked at that page extensively and seen nothing there that would
> handle my issue, long before I ever mailed the problem to this list.  What
> in particular from there did you see that would be useful to my use of
> fopen('http://etc')?
> 
> -Original Message-
> From: Dan Anderson [mailto:[EMAIL PROTECTED] 
> Sent: Saturday, July 05, 2003 5:28 PM
> To: Giz
> Cc: [EMAIL PROTECTED]
> Subject: RE: [PHP] Timing out fopen using https stream wrapper?
> 
> > This has no effect on stream operations.  I have a timeout set in
php.ini,
> > but the script never times out, so that should further illustrate the
> issue.
> 
> But if you'd visited the page I sent you and viewed user comments you
> would see how to set a time limit for socket operations (what you're
> doing).
> 
> -Dan
> 
> 



--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] Timing out fopen using https stream wrapper?

2003-07-05 Thread Dan Anderson
>From the user comments:
I think it might be useful to point out that set_time_limit() doesn't
have any effect on stream operations. A stalled script, either during
open operations (e.g. fsockopen()) or read operations (e.g. fgets()),
can make your script run "forever".

So it would be advisable to define timeouts for opening sockets (with
the timeout parameter in fsockopen()) and for reading data from sockets
(with socket_set_timeout()).

So, yes, you would have had to go to:
http://us3.php.net/manual/en/function.fsockopen.php

Sorry about that but I didn't exactly have lots of time on my hands at
the time to give you more details.

-Dan

On Sat, 2003-07-05 at 21:27, Giz wrote:
> I've looked at that page extensively and seen nothing there that would
> handle my issue, long before I ever mailed the problem to this list.  What
> in particular from there did you see that would be useful to my use of
> fopen('http://etc')?
> 
> -Original Message-
> From: Dan Anderson [mailto:[EMAIL PROTECTED] 
> Sent: Saturday, July 05, 2003 5:28 PM
> To: Giz
> Cc: [EMAIL PROTECTED]
> Subject: RE: [PHP] Timing out fopen using https stream wrapper?
> 
> > This has no effect on stream operations.  I have a timeout set in php.ini,
> > but the script never times out, so that should further illustrate the
> issue.
> 
> But if you'd visited the page I sent you and viewed user comments you
> would see how to set a time limit for socket operations (what you're
> doing).
> 
> -Dan
> 
> 


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] Timing out fopen using https stream wrapper?

2003-07-05 Thread Giz
I've looked at that page extensively and seen nothing there that would
handle my issue, long before I ever mailed the problem to this list.  What
in particular from there did you see that would be useful to my use of
fopen('http://etc')?

-Original Message-
From: Dan Anderson [mailto:[EMAIL PROTECTED] 
Sent: Saturday, July 05, 2003 5:28 PM
To: Giz
Cc: [EMAIL PROTECTED]
Subject: RE: [PHP] Timing out fopen using https stream wrapper?

> This has no effect on stream operations.  I have a timeout set in php.ini,
> but the script never times out, so that should further illustrate the
issue.

But if you'd visited the page I sent you and viewed user comments you
would see how to set a time limit for socket operations (what you're
doing).

-Dan



--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] Timing out fopen using https stream wrapper?

2003-07-05 Thread Dan Anderson
> This has no effect on stream operations.  I have a timeout set in php.ini,
> but the script never times out, so that should further illustrate the issue.

But if you'd visited the page I sent you and viewed user comments you
would see how to set a time limit for socket operations (what you're
doing).

-Dan


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] Timing out fopen using https stream wrapper?

2003-07-05 Thread Giz
That only works to set a timeout on reading data once the fopen has
successfully returned. The problem is that the fopen function is hanging.

-Original Message-
From: Arjen Brouwer [mailto:[EMAIL PROTECTED] 
Sent: Saturday, July 05, 2003 6:08 AM
To: Giz
Subject: Re: [PHP] Timing out fopen using https stream wrapper?

check: http://php.net/stream_set_timeout

- Original Message - 
From: "Giz" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Saturday, July 05, 2003 2:09 PM
Subject: [PHP] Timing out fopen using https stream wrapper?


> I have a class that uses fopen to read some xml data from a site with
> ongoing stability issues.  Fopen is using the stream wrapper for http.
>
> Something I've struggled with is finding a way to set a timeout value when
> fopen is attempting to get a page from a site that is inaccessible for
some
> reason.
>
> On my test server, the behavior is that fopen seems to hang up, and the
> script never returns.
>
> It seems I have been over the documentation repeatedly, but there simply
> isn't any documented way of setting a timeout duration.  Any ideas?
>
>
>
>
>
>
>
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>



--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] Timing out fopen using https stream wrapper?

2003-07-05 Thread Giz
This has no effect on stream operations.  I have a timeout set in php.ini,
but the script never times out, so that should further illustrate the issue.

-Original Message-
From: Dan Anderson [mailto:[EMAIL PROTECTED] 
Sent: Saturday, July 05, 2003 5:11 AM
To: Giz
Cc: [EMAIL PROTECTED]
Subject: Re: [PHP] Timing out fopen using https stream wrapper?

> It seems I have been over the documentation repeatedly, but there simply
> isn't any documented way of setting a timeout duration.  Any ideas? 

If you want to set a time out on execution of the /script/, check out:

http://us3.php.net/manual/en/function.set-time-limit.php

-Dan



--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Timing out fopen using https stream wrapper?

2003-07-05 Thread Dan Anderson
> It seems I have been over the documentation repeatedly, but there simply
> isn't any documented way of setting a timeout duration.  Any ideas? 

If you want to set a time out on execution of the /script/, check out:

http://us3.php.net/manual/en/function.set-time-limit.php

-Dan


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php