Example #1
0
 public function run()
 {
     while (($result = $this->ddpClient->getResult($this->method)) === null) {
     }
     call_user_func_array($this->callback, array($result));
     $this->threadPool->freeThread($this->threadId);
 }
Example #2
0
 function send($msg)
 {
     DDPClient::log('Sending ' . $msg . PHP_EOL);
     $msg = WebSocketClient::draft10Encode($msg, 'text', true);
     if (!fwrite($this->sock, $msg)) {
         throw new \Exception('Socket write error! ' . PHP_EOL);
     }
 }