📜  将用户映射到 ConnectionId SignalR - C# 代码示例

📅  最后修改于: 2022-03-11 14:48:46.748000             🧑  作者: Mango

代码示例1
public class MyHub: Hub
{
    public override Task OnConnected()
    {
        Groups.Add(Context.ConnectionId, Context.User.Identity.Name)

        return base.OnConnected();
    }
}