// Gets the connection pool for the specified service point (if it exists) and
        // invokes ForceCleanup to gracefully clean up any connections in the pool.
        //
        // preconditions: none
        //
        // postconditions: if a connection pool for the specified servicepoint and group name
        // exists, any open connections that are not in use will be gracefully cleaned up.
        //
        // Note: this will not destroy the connection pool itself so any future objects that
        // need that connection pool will still be able to access it to create new connections
        // and any objects using connections in the pool will still be able to return them
        internal static void CleanupConnectionPool(ServicePoint servicePoint, string groupName)
        {
            string key = GenerateKey(servicePoint.Host, servicePoint.Port, groupName);

            lock (InternalSyncObject) {
                ConnectionPool connectionPool = (ConnectionPool)(m_ConnectionPools[key]);
                if (connectionPool != null)
                {
                    connectionPool.ForceCleanup();
                }
            }
        }
Exemple #2
0
        internal static void CleanupConnectionPool(ServicePoint servicePoint, string groupName)
        {
            string str = GenerateKey(servicePoint.Host, servicePoint.Port, groupName);

            lock (InternalSyncObject)
            {
                ConnectionPool pool = (ConnectionPool)m_ConnectionPools[str];
                if (pool != null)
                {
                    pool.ForceCleanup();
                }
            }
        }