This commit is contained in:
2021-03-23 18:16:27 +08:00
parent e3a5ac51e4
commit 05c81ce77d
+5 -4
View File
@@ -52,10 +52,11 @@ class Client extends Component
if ($isSend === false) { if ($isSend === false) {
return $this->addError($this->client->errMsg . '(' . $this->client->errCode . ')'); return $this->addError($this->client->errMsg . '(' . $this->client->errCode . ')');
} }
Swoole\Coroutine\defer(function () {
$this->client->close(); $response = $this->client->recv();
}); $this->client->close();
if (is_bool($unpack = Json::decode($this->client->recv()))) {
if (is_bool($unpack = Json::decode($response))) {
return $this->addError('Service return data format error(500)'); return $this->addError('Service return data format error(500)');
} }
return $unpack; return $unpack;