Example #1
0
        public void UnsubscribeConnection(string deviceId)
        {
            lock (_lock)
            {
                var subscribedConnection = SubscribedConnections[deviceId];

                subscribedConnection.ConnectionState  = ConnectionState.LoggedIn;
                subscribedConnection.SubscriptionType = SubscriptionType.None;
                SubscribedConnections.Remove(deviceId);
            }
        }
Example #2
0
        public void CloseConnection(IPersistentConnection connection)
        {
            lock (_lock)
            {
                connection.ConnectionState  = ConnectionState.None;
                connection.SubscriptionType = SubscriptionType.None;

                if (connection.DeviceId == null)
                {
                    InitiatedConnections.Remove(connection.ConnectionId);
                }
                else
                {
                    LoggedInConnections.Remove(connection.DeviceId);
                    SubscribedConnections.Remove(connection.DeviceId);
                }
            }
        }