Hello,

I use Zend XmlRpc and I faced the following problem:
When the function on our server needs more execution time, the connection
times out, but no Exception is raised.
Instead "Unable to parse response or response is empty" error is displayed.
This is because when the connection times out, no response is returned and
no timeout Exception is raised.

In Zend_Http_Client there is
protected $config = array(
       'maxredirects'    => 5,
       'strictredirects' => false,
       'useragent'       => 'Zend_Http_Client',
       'timeout'         => 10,
       'adapter'         => 'Zend_Http_Client_Adapter_Socket',
       'httpversion'     => self::HTTP_1,
       'keepalive'       => false
   );

The $config['timeout'] is used for two different functions:
fsockopen() and stream_set_timeout() but the timeout parameter has different
meaning in each of them.

*Note: * If you need to set a timeout for reading/writing data over the
socket, use 
stream_set_timeout()<http://bg2.php.net/manual/en/function.stream-set-timeout.php>,
as the *timeout* parameter to *fsockopen()* only applies while connecting
the socket. - http://php.net/manual/en/function.fsockopen.php

stream_set_timeout — Set timeout period on a stream -
http://php.net/manual/en/function.stream-set-timeout.php

I temporary resolved the problem by increasing the value from 10 to 60, but
it should be fixed.
There should be two different timeouts - connect_timeout and
transfer_timeout.

There should be Exception for timeout, because:
When the stream times out, the 'timed_out' key of the array returned by
stream_get_meta_data()<http://bg.php.net/manual/en/function.stream-get-meta-data.php>is
set to
*TRUE*, although no error/warning is generated. -
http://php.net/manual/en/function.stream-set-timeout.php

Svetlin Tsvetanov
--
http://www.gsoccer.info

Reply via email to