public function run() { while (($result = $this->ddpClient->getResult($this->method)) === null) { } call_user_func_array($this->callback, array($result)); $this->threadPool->freeThread($this->threadId); }
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); } }