Esempio n. 1
0
        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();
            }
        }
Esempio n. 2
0
        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();
            }
        }