This commit is contained in:
as2252258@163.com
2021-08-24 01:06:10 +08:00
parent 489d34cbfa
commit 6bdc50a29e
+7 -1
View File
@@ -17,6 +17,7 @@ use Http\Context\Formatter\JsonFormatter;
use Http\Context\Formatter\XmlFormatter; use Http\Context\Formatter\XmlFormatter;
use Http\IInterface\IFormatter; use Http\IInterface\IFormatter;
use Kiri\Exception\NotFindClassException; use Kiri\Exception\NotFindClassException;
use Kiri\Kiri;
use Server\ResponseInterface; use Server\ResponseInterface;
use Server\ServerManager; use Server\ServerManager;
use Swoole\Http\Response as SResponse; use Swoole\Http\Response as SResponse;
@@ -64,10 +65,15 @@ class Response extends HttpService implements ResponseInterface
* @param int $int * @param int $int
* @param int $reID * @param int $reID
*/ */
public function setClientId(int $int, int $reID) public function setClientId(int $int, int $reID = null)
{ {
$this->clientId = $int; $this->clientId = $int;
$manager = Kiri::getDi()->get(ServerManager::class);
$this->_clientInfo = $manager->getServer()->getClientInfo($int);
if (!empty($this->reactorId))
{
$this->reactorId = $reID; $this->reactorId = $reID;
};
} }