예제 #1
0
        public void ConnectionPointsAmount()
        {
            ManualResetEvent sentinel = new ManualResetEvent(false);

            userFactory.SelectType(UserType.ConnectionTester);

            Console.Write("Threads amount: ");
            int threadsAmount = int.Parse(Console.ReadLine());

            Console.Write("Time, in milliseconds, while connection will be held: ");
            int time = int.Parse(Console.ReadLine());

            for (int index = 0; index < threadsAmount; index++)
            {
                ConnectionTester tester = userFactory.Get() as ConnectionTester;

                tester.Initialize(index, time, ref sentinel);
                tester.Work();
            }

            sentinel.Set();
        }