Re: socket timeout being ignored
- From: "yawnmoth" <terra1024@xxxxxxxxx>
- Date: 2 Aug 2006 14:56:37 -0700
Jerry Stuckle wrote:
yawnmoth wrote:That's a good point - it's been fixed :)
<snip>
What happens if the fsockopen() takes longer than 5 seconds?
See the note on fsockopen() - the timeout may not be available in all
environments. So a delay due to routing, server load or whatever may
cause the open to take longer than 5 seconds, putting a negative value
in your $timeout. I don't know what PHP will do with a negative value -
maybe convert it to a very large positive value?
Additionally, the timeout restarts every time you go a fgets(). TheSo I guess I should just use fread with as big a number as possible?
server could be sending one line every 4 seconds, for instance. 10
lines would be 40 seconds with no errors.
Like pow(2,20) or something?
The fact that fgets (and fread), though, can return empty lines, even
when they're in blocking mode, makes me think that this wouldn't work?
(I made another post about this)
.
- Follow-Ups:
- Re: socket timeout being ignored
- From: Jerry Stuckle
- Re: socket timeout being ignored
- References:
- socket timeout being ignored
- From: yawnmoth
- Re: socket timeout being ignored
- From: Jerry Stuckle
- socket timeout being ignored
- Prev by Date: Re: Case sensitivity in programming languages.
- Next by Date: Re: Case sensitivity in programming languages.
- Previous by thread: Re: socket timeout being ignored
- Next by thread: Re: socket timeout being ignored
- Index(es):
Relevant Pages
|