System.Net.ConnectionGroup.DisableKeepAliveOnConnections C# (CSharp) Method

DisableKeepAliveOnConnections() private method

private DisableKeepAliveOnConnections ( ) : void
return void
        internal void DisableKeepAliveOnConnections() {
            // The timer thread is allowed to call this.  (It doesn't call user code and doesn't block.)
            GlobalLog.ThreadContract(ThreadKinds.Unknown, ThreadKinds.SafeSources | ThreadKinds.Timer, "ConnectionGroup#" + ValidationHelper.HashString(this) + "::DisableKeepAliveOnConnections");

            lock (m_ConnectionList) {
                GlobalLog.Print("ConnectionGroup#" + ValidationHelper.HashString(this) + "::DisableKeepAliveOnConnections() Name = " + m_Name + ", Count:" + m_ConnectionList.Count);
                foreach (Connection currentConnection in m_ConnectionList) {
                    //
                    // For each Connection set KeepAlive to false
                    //
                    GlobalLog.Print("ConnectionGroup#" + ValidationHelper.HashString(this) + "::DisableKeepAliveOnConnections() setting KeepAlive to false Connection#" + ValidationHelper.HashString(currentConnection));
                    currentConnection.CloseOnIdle();
                }
                m_ConnectionList.Clear();
            }
        }

Usage Example

 internal bool ReleaseConnectionGroup(string connName)
 {
     lock (this)
     {
         ConnectionGroup group = this.FindConnectionGroup(connName, true);
         if (group == null)
         {
             return(false);
         }
         group.DisableKeepAliveOnConnections();
         this.m_ConnectionGroupList.Remove(connName);
     }
     return(true);
 }
All Usage Examples Of System.Net.ConnectionGroup::DisableKeepAliveOnConnections