There doesn’t seem to be a way to set a timeout on reading or writing streams in the XML-RPC library. Although there is functionality for setting a timeout in the library, the timeout value is only used in the call to fsockopen().
The timeout parameter of fsockopen() is only used for timing out the initial connection attempt. After the connection is established, timeouts for reading and writing data revert to default (I think five seconds?). In order to set a timeout for reading and writing data, you need a subsequent call to stream_set_timeout(). Further complicating things, it seems that stream_set_timeout() only applies to the next operation—so if you set the timeout, write some data, and then wait for a response, you need to set the timeout again after the write.
As it is now, if you read data over XML-RPC that takes more than the default timeout to get to you, CI will erroneously close the socket and report ‘no data received’.
Fixing this properly will take some modification of the XML-RPC classes that comprise the library (not to mention some decisions on setting one timeout vs. multiple timeouts), but if you want a quick-and-dirty fix for reading data, you can put a call to stream_set_timeout() in Xmlrpc.php:
function parseResponse($fp)
{
stream_set_timeout($fp, 80);
$data = '';
...
The other possible problem with this is that stream_set_timeout is only part of PHP >=4.3.0. I don’t know what CI’s policy is on PHP minimum versions, nor what you’re supposed to do for PHP versions prior to 4.3.0.
It might also make sense for CI to check the ‘timed_out’ key from the results of stream_get_meta_data() in order to provide a more informative error message.
