Ejemplo n.º 1
0
        static void Main(string[] args)
        {
            finishedTokenQ = new AsyncQueue <int>();

            int    receivePort        = 1001;
            int    sendPort           = 1000;
            string clientInstanceName = "client";
            string serverInstanceName = "server";

            if (args.Length >= 1)
            {
                clientInstanceName = args[0];
            }

            if (args.Length == 2)
            {
                serverInstanceName = args[1];
            }

            Client2 client = new Client2(serverInstanceName);

            using (var c = AmbrosiaFactory.Deploy <IClient2>(clientInstanceName, client, receivePort, sendPort))
            {
                while (finishedTokenQ.IsEmpty)
                {
                    finishedTokenQ.DequeueAsync().Wait();
                }
            }
        }
Ejemplo n.º 2
0
        static void Main(string[] args)
        {
            finishedTokenQ = new AsyncQueue <int>();

            int    coordinatorPort    = 1500;
            string clientInstanceName = "client";
            string serverInstanceName = "server";

            if (args.Length >= 1)
            {
                clientInstanceName = args[0];
            }

            if (args.Length == 2)
            {
                serverInstanceName = args[1];
            }

            Client2 client = new Client2(serverInstanceName);

            using (var coordinatorOutput = new StreamWriter("CoordOut.txt", false))
            {
                var iCListener = new TextWriterTraceListener(coordinatorOutput);
                Trace.Listeners.Add(iCListener);
                GenericLogsInterface.SetToGenericLogs();
                using (AmbrosiaFactory.Deploy <IClient2>(clientInstanceName, client, coordinatorPort))
                {
                    finishedTokenQ.DequeueAsync().Wait();
                }
            }
        }
Ejemplo n.º 3
0
        static void Main(string[] args)
        {
            Client2 server = new Client2();

            Console.WriteLine("Client2 started...");
            server.Run("127.0.0.1", 15002);
        }
Ejemplo n.º 4
0
        static void Main(string[] args)
        {
            try
            {
                Console.Write("\n CLIENT2");
                Console.Write("\n =====================\n");

                Client2 client2 = new Client2();

                ClientFileManager fileManager = new ClientFileManager();
                //////// Implementing code for sending DLL's to repository before sending the test request.

                fileManager.client_Manager("client2");

                // creating messages to send to Test Harness Server
                Messages msg = client2.makeMessage("Ashu", client2.endPoint, client2.endPoint);
                string   TestHarnessEndPoint = Comm <Client2> .makeEndPoint("http://localhost", 8080);

                msg.toUrl           = TestHarnessEndPoint;
                msg.command         = "TestRequest";
                msg.message_content = ClientMessages.makeTestRequestClient2();
                " [[ Displaying Requirement 2 and 6 (Test Request)---->>> XML Body sent as a part of Request and specifies DLL's to execute  ]]".title('=');
                msg.show();
                Console.WriteLine("----------------------------------------------------------------------------------");
                client2.comm.sndr.PostMessage(msg);

                Console.ReadKey();

                Console.Write("\n  press key to exit: ");
                Console.ReadKey();

                client2.wait();
                Console.Write("\n\n");
            }
            catch (Exception ex)
            {
                Console.WriteLine("Exception caught {0}", ex.Message);
            }
            Console.ReadKey();
        }
Ejemplo n.º 5
0
        static void Main(string[] args)
        {
            finishedTokenQ = new AsyncQueue <int>();

            int    receivePort        = 1001;
            int    sendPort           = 1000;
            string clientInstanceName = "client2";
            string serverInstanceName = "server1";

            Client2 client = new Client2(serverInstanceName);

            using (var c = AmbrosiaFactory.Deploy <IClient2.IClient2>(clientInstanceName, client, receivePort, sendPort))
            {
                while (finishedTokenQ.IsEmpty)
                {
                    Console.Write("Enter a message (hit ENTER to send): ");
                    string input = Console.ReadLine();
                    client.IngressKeyboardInput(input);
                    Thread.Sleep(1000);
                }
                finishedTokenQ.DequeueAsync().Wait();
            }
        }