예제 #1
0
        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));
        }
예제 #2
0
        public override Task OnConnected()
        {
            string clientId = GetClientId();

            if (Users.IndexOf(clientId) == -1)
            {
                Users.Add(clientId);
                counter = CounterLog.Increment();
                Send(counter);
            }

            return(base.OnConnected());
        }