DoraRPC\Client::waitResult PHP Метод

waitResult() приватный Метод

return the right guid request
private waitResult ( $client )
    private function waitResult($client)
    {
        while (1) {
            $result = $client->recv();
            if ($result !== false && $result != "") {
                $data = Packet::packDecode($result);
                //if the async result first deploy success will
                if ($data["data"]["guid"] != $this->guid) {
                    // this data was not we want
                    //it's may the async result
                    //when the guid on the asynclist and have isresult =1  on data is async result
                    //when the guid on the asynclist not have isresult field ond data is first success deploy msg
                    if (isset(self::$asynclist[$data["data"]["guid"]]) && isset($data["data"]["isresult"]) && $data["data"]["isresult"] == 1) {
                        //ok recive an async result
                        //remove the guid on the asynclist
                        unset(self::$asynclist[$data["data"]["guid"]]);
                        //add result to async result
                        self::$asynresult[$data["data"]["guid"]] = $data["data"];
                        self::$asynresult[$data["data"]["guid"]]["fromwait"] = 1;
                    } else {
                        //not in the asynclist drop this packet
                        continue;
                    }
                } else {
                    //founded right data
                    return $data;
                }
            } else {
                //time out
                $packet = Packet::packFormat("the recive wrong or timeout", 100009);
                $packet["guid"] = $this->guid;
                return $packet;
            }
        }
    }