Exemple #1
0
        public override async Task OnDisconnectedAsync(Exception exception)
        {
            var item = connects.FirstOrDefault(e => e.Key == this.Context.ConnectionId);
            connects.TryRemove(item);


            Console.WriteLine("客户端离线:" + this.Context.ConnectionId + " userId:" + item.Value);
            await base.OnDisconnectedAsync(exception);
        }