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); }
public virtual string GetServerGroupID(string serverID) { using (serverListLock.EnterRead()) { if (serverList.TryGetValue(serverID, out var info)) { return(info.group); } } return(null); }
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>()); } }