Re: php in free()

From: Date: Tue, 18 Dec 2001 09:16:52 +0000
Subject: Re: php in free()
References: 1 2  Groups: php.general 
Request: Send a blank email to php-general+get-78046@lists.php.net to get a copy of this message
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" <Jan.Maska@systinet.com> To: <php-general@lists.php.net> 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: php-general-unsubscribe@lists.php.net > For additional commands, e-mail: php-general-help@lists.php.net > To contact the list administrators, e-mail: php-list-admin@lists.php.net > >

« previous php.general (#78046) next »