Example #1
0
 /**
  * @param Client $client
  * @param string $id
  * @param int    $timeout
  */
 protected function waitForServer(Client $client, $id, $timeout = 5)
 {
     $time = time();
     do {
         $client->pollMessages();
     } while ($this->receivedId !== $id && time() - $time < $timeout);
 }
 public function checkForNewMessages()
 {
     $this->connectAndLogin();
     $this->client->pollMessages();
     $this->logoutAndDisconnect();
 }