Esempio n. 1
0
        public override void Close()
        {
            if (connection != null)
            {
                connection.Close();
            }

            if (dataReader != null)
            {
                dataReader = null;
            }

            ChangeState(ConnectionState.Closed);
        }
Esempio n. 2
0
 public static void Clear()
 {
     Console.WriteLine("Pool clear start!");
     timer.Stop();
     contentLock.AcquireWriterLock(-1);
     foreach (LinkedList <ITdsConnection> list in contents.Values)
     {
         while (list.Count != 0)
         {
             LinkedListNode <ITdsConnection> node = list.First;
             ITdsConnection connection            = node.Value;
             list.RemoveFirst();
             connection.Close();
         }
     }
     contentLock.ReleaseWriterLock();
     timer.Start();
     Console.WriteLine("Pool clear end!");
 }