PHP Doku:: Perform socket actions - function.httprequestpool-socketperform.html

Verlauf / Chronik / History: (20) anzeigen

Sie sind hier:
Doku-StartseitePHP-HandbuchFunktionsreferenzSonstige DiensteHTTPThe HttpRequestPool classHttpRequestPool::socketPerform

Ein Service von Reinhard Neidl - Webprogrammierung.

The HttpRequestPool class

<<HttpRequestPool::send

HttpRequestPool::socketSelect>>

HttpRequestPool::socketPerform

(PECL pecl_http >= 0.15.0)

HttpRequestPool::socketPerformPerform socket actions

Beschreibung

protected bool HttpRequestPool::socketPerform ( void )

Returns TRUE until each request has finished its transaction.

Rückgabewerte

Returns TRUE until each request has finished its transaction.

Beispiele

Beispiel #1 A HttpRequestPool::socketPerform() example

<?php
class MyPool extends HttpRequestPool
{
    public function 
send()
    {
        while (
$this->socketPerform()) {
            if (!
$this->socketSelect()) {
                throw new 
HttpSocketExcpetion;
            }
        }
    }

    protected final function 
socketPerform()
    {
        
$result parent::socketPerform();
        foreach (
$this->getFinishedRequests() as $r) {
            
$this->detach($r);
            
// handle response of finished request
        
}
        return 
$result;
    }
}
?>


Keine BenutzerBeiträge.
- Beiträge aktualisieren...



PHP Powered Diese Seite bei php.net
The PHP manual text and comments are covered by the Creative Commons Attribution 3.0 License © the PHP Documentation Group - Impressum - mail("TO:Reinhard Neidl",...)