Exemple #1
0
            internal HashMap <string, int> GetGroupSessionNumbers()
            {
                var ret = new HashMap <string, int>();

                using (lock_rw.EnterRead())
                {
                    foreach (var e in groupSessionsMap)
                    {
                        ret.Add(e.Key, e.Value.Count);
                    }
                }
                return(ret);
            }
Exemple #2
0
        public virtual string GetServerGroupID(string serverID)
        {
            using (serverListLock.EnterRead())
            {
                if (serverList.TryGetValue(serverID, out var info))
                {
                    return(info.group);
                }
            }

            return(null);
        }
Exemple #3
0
 public IEnumerable <string> GetConnections(string userId)
 {
     using (_readerWriterLock.EnterRead())
     {
         HashSet <string> connectionIds;
         if (_userToConnectionsMap.TryGetValue(userId, out connectionIds))
         {
             return(connectionIds.ToList());
         }
         return(Enumerable.Empty <string>());
     }
 }