1 # bool http\Client::once()
3 Perform outstanding transfer actions.
4 See http\Client::wait() for the completing interface.
12 * bool, true if there are more transfers to complete.
17 $client = new http\Client;
18 $client->enqueue(new http\Client\Request("HEAD", "http://php.net"));
19 $client->enqueue(new http\Client\Request("HEAD", "http://pecl.php.net"));
20 $client->enqueue(new http\Client\Request("HEAD", "http://pear.php.net"));
22 printf("Transfers ongoing");
23 while ($client->once()) {
24 // do something else here while the network transfers are busy
26 // and then call http\Client::wait() to wait for new input
31 while ($res = $client->getResponse()) {
32 printf("%s returned %d\n", $res->getTransferInfo("effective_url"),
33 $res->getResponseCode());
38 Transfers ongoing....................................................
39 http://php.net/ returned 200
40 http://pecl.php.net/ returned 200
41 http://pear.php.net/ returned 200