Esempio n. 1
0
        // Token: 0x060001B6 RID: 438 RVA: 0x000094C4 File Offset: 0x000076C4
        internal static NspiConnection GetConnection(string server, PartitionId partitionId)
        {
            NspiConnectionPool.NspiConnectionTracer.TraceDebug <string>(0L, "NspiConnectionPool.GetConnection: {0}", server ?? "(null)");
            if (string.IsNullOrEmpty(server))
            {
                if (!string.IsNullOrEmpty(Configuration.NspiTestServer))
                {
                    server = Configuration.NspiTestServer;
                    NspiConnectionPool.NspiConnectionTracer.TraceDebug <string>(0L, "Using test server: {0}", server ?? "(null)");
                }
                else
                {
                    ADRunspaceServerSettingsProvider instance = ADRunspaceServerSettingsProvider.GetInstance();
                    bool flag;
                    server = instance.GetGcFromToken(partitionId.ForestFQDN, null, out flag, false).Fqdn;
                    NspiConnectionPool.NspiConnectionTracer.TraceDebug <string>(0L, "Using GC: {0}", server ?? "(null)");
                }
            }
            NspiConnectionPool nspiConnectionPool;

            lock (NspiConnectionPool.pools)
            {
                if (!NspiConnectionPool.pools.TryGetValue(server, out nspiConnectionPool))
                {
                    nspiConnectionPool = new NspiConnectionPool(server);
                    NspiConnectionPool.pools[server] = nspiConnectionPool;
                }
            }
            return(nspiConnectionPool.GetConnectionFromPool());
        }
 // Token: 0x060001AC RID: 428 RVA: 0x000092BA File Offset: 0x000074BA
 internal NspiConnection(NspiConnectionPool owningPool)
 {
     this.owningPool = owningPool;
 }