prerelease of beta1

This commit is contained in:
crazywhalecc
2022-12-20 20:10:40 +08:00
parent 04247048d4
commit c9bf0fb13c
16 changed files with 585 additions and 43 deletions

View File

@@ -49,6 +49,7 @@ class ConnectionUtil
*/
public static function setConnection(int $fd, array $handle): void
{
logger()->notice('设置连接情况:' . json_encode($handle));
self::$connection_handles[$fd] = array_merge(self::$connection_handles[$fd] ?? [], $handle);
// 这里下面为连接准入,允许接入反向 WS
if (ProcessStateManager::$process_mode['worker'] > 1) {
@@ -72,4 +73,15 @@ class ConnectionUtil
@unlink(zm_dir(ZM_STATE_DIR . '/.WS' . $fd . '.' . ProcessManager::getProcessId()));
}
}
/**
* 获取记录连接内容的特殊信息
*
* @param int $fd WS 连接 ID
* @return null|mixed
*/
public static function getConnection(int $fd)
{
return self::$connection_handles[$fd] ?? null;
}
}