public void RemoveClient(string auth) { s2hClient Client = GetClient(auth); if (Client != null) { lock (m_Clients) { string [] connectionHandles = Client.ConnectionHandles; foreach (string s in connectionHandles) { m_DataExchanger.CloseConnection(s); } Client.CloseAllConnections(); m_Clients.Remove(auth); } } }
public s2hClient GetClient(string auth) { lock (m_Clients) { if (m_Clients.Contains(auth)) { s2hClient client = (s2hClient)m_Clients[auth]; long nowIs = DateTime.Now.ToFileTime(); if (((nowIs - client.LastSeen) / (10 * 1000000)) > 60 * 5) { client.CloseAllConnections(); m_Clients.Remove(client.AuthToken); return(null); } client.ResetLastSeen(); return(client); } else { return(null); } } }