This commit is contained in:
2021-02-04 17:52:44 +08:00
parent a04e120424
commit 6e66984197
+16
View File
@@ -77,6 +77,22 @@ class Request extends Application
$this->fd = $fd;
}
/**
* @return array|null
* @throws ComponentException
*/
public function getConnectInfo(): array|null
{
if (empty($this->fd)) {
return null;
}
$server = Snowflake::app()->getSwoole();
return $server->connection_info($this->fd);
}
/**
* @return bool
*/