This is because the reading from socket is blocked_read by default. So there is 
fuinction socket_set_blocking() and also
socket_set_timeout().
I had the same problem so as workaround set_time_limit(0) but the script works for 40 
!! seconds. My aim was to get some header so I
didn't read from the socket until feof($fp) but stopped somewhere before the end of 
data and close()-ing socket after that. After
this intervention the time which the scripts uses is 4!!! seconds.


Regards,
Andrey Hristov
IcyGEN Corporation
http://www.icygen.com
BALANCED SOLUTIONS

----- Original Message -----
From: "Jan Maska" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Tuesday, December 18, 2001 11:07 AM
Subject: Re: [PHP] php in free()


> I'm not sure which way you create the connection, but I suppose that you use
> FSockOpen..
>
> This is a buggy function, as far as I know..
> Zend promised to take care of it in the 4.0.4 release of PHP, but since that
> nothing has changed, apparently.
> I had the same problem some week ago. In the end I had to use PERL script
> via PHP function exec().
>
> And here's the bug:
> After calling a socket, PHP interpreter simply keeps all data in memory,
> doesn;t close connection, keeps trying to read, and finaly stucks.. which
> can lead to an extreme overload on your server (tried it on Apache and IIS).
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>
>


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to