This commit is contained in:
2020-11-14 02:00:09 +08:00
parent 2ba9e2ad5f
commit 98889ecf57
+3 -1
View File
@@ -39,7 +39,9 @@ class OnReceive extends Callback
public function onHandler(\Swoole\Server $server, int $fd, int $reID, string $data)
{
try {
$data = DataResolve::unpack($this->unpack, null, null, $data);
$client = $server->getClientInfo($fd, $reID);
$data = DataResolve::unpack($this->unpack, $client['remote_ip'], $client['remote_port'], $data);
if (empty($data)) {
throw new Exception('Format error.');
}