to process intermediate request results
* public function send()
* {
* while ($this->socketPerform()) {
- * $this->handleRequests();
* if (!$this->socketSelect()) {
* throw new HttpSocketExcpetion;
* }
* }
- * $this->handleRequests();
* }
*
- * private function handleRequests()
+ * protected final function socketPerform()
* {
+ * $result = parent::socketPerform();
* foreach ($this->getFinishedRequests() as $r) {
* $this->detach($r);
* // handle response of finished request
* }
+ * return $result;
* }
* }
* ?>
public function send()
{
while ($this->socketPerform()) {
- $this->handleRequests();
if (!$this->socketSelect()) {
throw new HttpSocketException;
}
}
- $this->handleRequests();
}
- private function handleRequests()
+ protected final function socketPerform()
{
+ $result = parent::socketPerform();
+
echo ".";
foreach ($this->getFinishedRequests() as $r) {
echo "=", $r->getResponseCode(), "=";
$this->detach($r);
}
+
+ return $result;
}
}