public override async Task OnDisconnectedAsync(Exception exception) { await Groups.RemoveFromGroupAsync(Context.ConnectionId, "SignalR Users"); await base.OnDisconnectedAsync(exception); NLogHelp.InfoLog($"SignalR连接断开,连接Id:{Context.ConnectionId}"); }
public override async Task OnConnectedAsync() { await Groups.AddToGroupAsync(Context.ConnectionId, "SignalR Users"); await base.OnConnectedAsync(); NLogHelp.InfoLog($"新的SignalR连接建立,连接Id:{Context.ConnectionId}"); }