This commit is contained in:
2021-03-23 18:14:50 +08:00
parent 35e4d3874b
commit e3a5ac51e4
+4 -2
View File
@@ -6,7 +6,7 @@ namespace Rpc;
use Exception;
use Snowflake\Abstracts\Component;
use Snowflake\Abstracts\Config;
use Swoole;
use Snowflake\Core\Json;
use Snowflake\Exception\ConfigException;
use Swoole\Coroutine\Client as CClient;
@@ -52,7 +52,9 @@ class Client extends Component
if ($isSend === false) {
return $this->addError($this->client->errMsg . '(' . $this->client->errCode . ')');
}
Swoole\Coroutine\defer(function () {
$this->client->close();
});
if (is_bool($unpack = Json::decode($this->client->recv()))) {
return $this->addError('Service return data format error(500)');
}