// but still not get the response requested
$startTime = microtime(true);
- do {
- $resp = $this->readPacket();
-
+ while ($resp = $this->readPacket()) {
if ($resp['type'] == self::STDOUT || $resp['type'] == self::STDERR) {
if ($resp['type'] == self::STDERR) {
$this->_requests[$resp['requestId']]['state'] = self::REQ_STATE_ERR;
$this->set_ms_timeout($this->_readWriteTimeout);
throw new \Exception('Timed out');
}
- } while ($resp);
+ }
if (!is_array($resp)) {
$info = stream_get_meta_data($this->_sock);