コード例 #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());
        }
コード例 #2
0
ファイル: SmppShareManager.cs プロジェクト: pesaply/sharp-sms
 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();
 }