private void RegisterClient(HttpClient client) { if (client == null) { throw new ArgumentNullException("client"); } #if DEBUG Debug.WriteLine("Register client " + client.ToString()); #endif lock (_syncLock) { _clients.Add(client, true); _clientsChangedEvent.Set(); } }
internal void UnregisterClient(HttpClient client) { if (client == null) { throw new ArgumentNullException("client"); } #if DEBUG Debug.WriteLine("Unregister client " + client.ToString()); #endif lock (_syncLock) { Debug.Assert(_clients.ContainsKey(client)); _clients.Remove(client); _clientsChangedEvent.Set(); } }