public override Task OnDisconnected(bool stopCalled) { string clientId = GetClientId(); if (Users.IndexOf(clientId) > -1) { Users.Remove(clientId); counter = CounterLog.Descrement(); Send(counter); } return(base.OnDisconnected(stopCalled)); }
public override Task OnConnected() { string clientId = GetClientId(); if (Users.IndexOf(clientId) == -1) { Users.Add(clientId); counter = CounterLog.Increment(); Send(counter); } return(base.OnConnected()); }