- better example/approach of using the protected HttpRequestPool methods
[m6w6/ext-http] / tests / HttpRequestPool_002.phpt
index 053f1f6b76804c3d769b229c516f1f3e4aeaf1dd..26b11593caec8b869011a4fcd96f925ad5beb51a 100644 (file)
@@ -14,21 +14,23 @@ class MyPool extends HttpRequestPool
        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;
        }
 }