コード例 #1
0
        public override async Task OnDisconnectedAsync(Exception exception)
        {
            string name = Context.User.Identity.Name;

            ConnectionMapping <string> .Remove(name, Context.ConnectionId);

            await base.OnDisconnectedAsync(exception);
        }
コード例 #2
0
        public override async Task OnConnectedAsync()
        {
            string name = Context.User.Identity.Name;

            ConnectionMapping <string> .Add(name, Context.ConnectionId);

            await base.OnConnectedAsync();
        }