Thank you to anyone who has already donated - your generous donations helped make three months of treatment possible.
My brother Nate continues to fight stage IV Hodgkin's lymphoma. He's just 31, with a wife and baby girl. They have no active income (since he's been unable to return to work), no insurance, and cannot afford the treatment he needs. Nate and his family need your help. Please consider a donation, every dollar helps. Thanks.
/*
The problem:
In order to pipeline requests to the same webserver the following function was created, following the documentation for the Zend_Http_Client documentation. However, there appears to be something in the Zend_XmlRpc_Client code which isn't taking into account URI changes.
For this example let's suppose class1 has one function called hello, and class2 one function called goodbye.
*/
class myTest {
protected $_client;
protected function getClient($url,$class) {
if (isset ( $this->_client[$url] )) {
$this->_client[$url]->getHttpClient ()->resetParameters();
$this->_client[$url]->getHttpClient ()->setUri ( $url . $class);
return $this->_client [$url];
} else {
$this->_client [$url] = new Zend_XmlRpc_Client ( $url . $class);
$this->_client [$url]->getHttpClient ()->setConfig ( array ('adapter' => 'Zend_Http_Client_Adapter_Socket', 'keepalive' => true ) );
$this->_client [$url]->setSkipSystemLookup ( true );
return $this->client [$url];
}
}
public function doFirst() {
$client = $this->getClient('http://example.com/','class1');
$client->call('hello');
}
public function doSecond() {
$client = $this->getClient('http://example.com/','class2');
$client->call('goodbye');
}
}
$t = new myTest();
$t->doFirst();
$t->doSecond(); // This call will fail, as the http request is going to be hitting the first URL.
|