Exemplo n.º 1
0
        //
        // DecrementConnection
        //
        // Call to indicate that we now are removing
        //  a connection within this connection group
        //

        internal void DecrementConnection()
        {
            GlobalLog.Print("DecrementConnection #" + m_CurrentConnections.ToString() + "  #" + this.GetHashCode().ToString());
            // we need these to be atomic operations
            lock (this) {
                m_CurrentConnections--;

                if (m_CurrentConnections == 0)
                {
                    MarkIdle();
                    ServicePointManager.AddIdleServicePoint(this);
                }
                else if (m_CurrentConnections < 0)
                {
                    m_CurrentConnections = 0;
                }
            }
        }