Esempio n. 1
0
        internal static SmppInternalConnection GetConnection(SmppSettings Settings)
        {
            SmppShare share;

            if (Deactivated)
            {
                throw new SmppException("The SmppPoolManager is in process of deactivation");
            }
            if (Pools == null)
            {
                Initialize();
            }
            string connectionString = Settings.ConnectionString;

            lock (Pools.SyncRoot) {
                if (!Pools.Contains(connectionString))
                {
                    share = new SmppShare(Settings);
                    Pools.Add(connectionString, share);
                }
                else
                {
                    share          = Pools[connectionString] as SmppShare;
                    share.Settings = Settings;
                }
            }
            return(share.GetConnection());
        }
Esempio n. 2
0
 internal static SmppInternalConnection GetConnection(SmppSettings Settings) {
   SmppShare share;
   if (Deactivated)
     throw new SmppException("The SmppPoolManager is in process of deactivation");
   if (Pools == null)
     Initialize();
   string connectionString = Settings.ConnectionString;
   lock (Pools.SyncRoot) {
     if (!Pools.Contains(connectionString)) {
       share = new SmppShare(Settings);
       Pools.Add(connectionString, share);
     } else {
       share = Pools[connectionString] as SmppShare;
       share.Settings = Settings;
     }
   }
   return share.GetConnection();
 }