Beispiel #1
0
        /// <summary>

        /// Entry point into console application.

        /// </summary>

        static void Main()
        {
            LoadBalancer b1 = LoadBalancer.GetLoadBalancer();

            LoadBalancer b2 = LoadBalancer.GetLoadBalancer();

            LoadBalancer b3 = LoadBalancer.GetLoadBalancer();

            LoadBalancer b4 = LoadBalancer.GetLoadBalancer();



            // Same instance?

            if (b1 == b2 && b2 == b3 && b3 == b4)
            {
                Console.WriteLine("Same instance\n");
            }



            // Load balance 15 server requests

            LoadBalancer balancer = LoadBalancer.GetLoadBalancer();

            for (int i = 0; i < 15; i++)
            {
                string server = balancer.Server;

                Console.WriteLine("Dispatch Request to: " + server);
            }



            // Wait for user

            Console.ReadKey();
        }
        /// <summary>
        /// Entry point into console application.
        /// </summary>
        static void Main()
        {
            LoadBalancer b1 = LoadBalancer.GetLoadBalancer();
            LoadBalancer b2 = LoadBalancer.GetLoadBalancer();
            LoadBalancer b3 = LoadBalancer.GetLoadBalancer();
            LoadBalancer b4 = LoadBalancer.GetLoadBalancer();

            // Same instance?
            if (b1 == b2 && b2 == b3 && b3 == b4)
            {
                Console.WriteLine("Same instance\n");
            }

            // All are the same instance -- use b1 arbitrarily
            // Load balance 15 server requests
            for (int i = 0; i < 15; i++)
            {
                Console.WriteLine(b1.Server);
            }

            // Wait for user
            Console.Read();
        }
Beispiel #3
0
        static void Main()
        {
            LoadBalancer b1 = LoadBalancer.GetLoadBalancer();
            LoadBalancer b2 = LoadBalancer.GetLoadBalancer();
            LoadBalancer b3 = LoadBalancer.GetLoadBalancer();
            LoadBalancer b4 = LoadBalancer.GetLoadBalancer();

            // Iste instance?
            if (b1 == b2 && b2 == b3 && b3 == b4)
            {
                Console.WriteLine("Same instance\n");
            }

            // Pošto su svi zapravo ista instanca b1 će se koristiti arbitrarno
            // Učitavanje 15 zahteva serveru
            for (int i = 0; i < 15; i++)
            {
                Console.WriteLine(b1.Server);
            }

            // Čekanje na korisnički unos
            Console.Read();
        }