Beispiel #1
0
        public override async Task RunAsync(string[] args)
        {
            Dictionary <string, string> properties = CreateTestProperties(ref args);

            properties["Ice.Warn.Dispatch"]        = "0";
            properties["Ice.Warn.Connections"]     = "0";
            properties["Ice.IncomingFrameSizeMax"] = "10K";
            await using Communicator communicator  = Initialize(properties);
            communicator.SetProperty("TestAdapter.Endpoints", GetTestEndpoint(0));
            communicator.SetProperty("TestAdapter2.Endpoints", GetTestEndpoint(1));
            communicator.SetProperty("TestAdapter2.IncomingFrameSizeMax", "0");
            communicator.SetProperty("TestAdapter3.Endpoints", GetTestEndpoint(2));
            communicator.SetProperty("TestAdapter3.IncomingFrameSizeMax", "1K");

            ObjectAdapter adapter  = communicator.CreateObjectAdapter("TestAdapter");
            ObjectAdapter adapter2 = communicator.CreateObjectAdapter("TestAdapter2");
            ObjectAdapter adapter3 = communicator.CreateObjectAdapter("TestAdapter3");
            var           obj      = new Thrower();

            adapter.Add("thrower", obj);
            adapter2.Add("thrower", obj);
            adapter3.Add("thrower", obj);
            await adapter.ActivateAsync();

            await adapter2.ActivateAsync();

            await adapter3.ActivateAsync();

            ServerReady();
            await communicator.WaitForShutdownAsync();
        }
Beispiel #2
0
        public override void Run(string[] args)
        {
            Dictionary <string, string> properties = CreateTestProperties(ref args);

            properties["Ice.Warn.Dispatch"]    = "0";
            properties["Ice.Warn.Connections"] = "0";
            properties["Ice.MessageSizeMax"]   = "10"; // 10KB max
            using Communicator communicator    = Initialize(properties);
            communicator.SetProperty("TestAdapter.Endpoints", GetTestEndpoint(0));
            communicator.SetProperty("TestAdapter2.Endpoints", GetTestEndpoint(1));
            communicator.SetProperty("TestAdapter2.MessageSizeMax", "0");
            communicator.SetProperty("TestAdapter3.Endpoints", GetTestEndpoint(2));
            communicator.SetProperty("TestAdapter3.MessageSizeMax", "1");

            ObjectAdapter adapter  = communicator.CreateObjectAdapter("TestAdapter");
            ObjectAdapter adapter2 = communicator.CreateObjectAdapter("TestAdapter2");
            ObjectAdapter adapter3 = communicator.CreateObjectAdapter("TestAdapter3");
            var           obj      = new Thrower();

            adapter.Add("thrower", obj);
            adapter2.Add("thrower", obj);
            adapter3.Add("thrower", obj);
            adapter.Activate();
            adapter2.Activate();
            adapter3.Activate();
            ServerReady();
            communicator.WaitForShutdown();
        }
Beispiel #3
0
        public override async Task RunAsync(string[] args)
        {
            Dictionary <string, string> properties = CreateTestProperties(ref args);

            properties["Ice.Warn.Dispatch"]        = "0";
            properties["Ice.Warn.Connections"]     = "0";
            properties["Ice.IncomingFrameMaxSize"] = "10K";
            await using Communicator communicator  = Initialize(properties);
            await communicator.ActivateAsync();

            communicator.SetProperty("TestAdapter.Endpoints", GetTestEndpoint(0));
            communicator.SetProperty("TestAdapter2.Endpoints", GetTestEndpoint(1));
            communicator.SetProperty("TestAdapter2.IncomingFrameMaxSize", "0");
            communicator.SetProperty("TestAdapter3.Endpoints", GetTestEndpoint(2));
            communicator.SetProperty("TestAdapter3.IncomingFrameMaxSize", "1K");

            ObjectAdapter adapter  = communicator.CreateObjectAdapter("TestAdapter");
            ObjectAdapter adapter2 = communicator.CreateObjectAdapter("TestAdapter2");
            ObjectAdapter adapter3 = communicator.CreateObjectAdapter("TestAdapter3");
            var           obj      = new Thrower();

            ZeroC.Ice.IObjectPrx prx = adapter.Add("thrower", obj, ZeroC.Ice.IObjectPrx.Factory);
            adapter2.Add("thrower", obj);
            adapter3.Add("thrower", obj);
            await adapter.ActivateAsync();

            await adapter2.ActivateAsync();

            await adapter3.ActivateAsync();

            await using var communicator2 = new Communicator(properties);
            await communicator2.ActivateAsync();

            communicator2.SetProperty("ForwarderAdapter.Endpoints", GetTestEndpoint(3));
            communicator2.SetProperty("ForwarderAdapter.IncomingFrameMaxSize", "0");
            ObjectAdapter forwarderAdapter = communicator2.CreateObjectAdapter("ForwarderAdapter");

            forwarderAdapter.Add("forwarder", new Forwarder(IObjectPrx.Parse(GetTestProxy("thrower"), communicator2)));
            await forwarderAdapter.ActivateAsync();

            ServerReady();
            await communicator.WaitForShutdownAsync();
        }
Beispiel #4
0
        public override async Task RunAsync(string[] args)
        {
            await Communicator.ActivateAsync();

            Dictionary <string, string> properties = Communicator.GetProperties();

            Communicator.SetProperty("TestAdapter.Endpoints", GetTestEndpoint(0));
            Communicator.SetProperty("TestAdapter2.Endpoints", GetTestEndpoint(1));
            Communicator.SetProperty("TestAdapter2.IncomingFrameMaxSize", "0");
            Communicator.SetProperty("TestAdapter3.Endpoints", GetTestEndpoint(2));
            Communicator.SetProperty("TestAdapter3.IncomingFrameMaxSize", "1K");

            ObjectAdapter adapter  = Communicator.CreateObjectAdapter("TestAdapter");
            ObjectAdapter adapter2 = Communicator.CreateObjectAdapter("TestAdapter2");
            ObjectAdapter adapter3 = Communicator.CreateObjectAdapter("TestAdapter3");
            var           obj      = new Thrower();

            ZeroC.Ice.IObjectPrx prx = adapter.Add("thrower", obj, ZeroC.Ice.IObjectPrx.Factory);
            adapter2.Add("thrower", obj);
            adapter3.Add("thrower", obj);
            await adapter.ActivateAsync();

            await adapter2.ActivateAsync();

            await adapter3.ActivateAsync();

            await using var communicator2 = new Communicator(properties);
            await communicator2.ActivateAsync();

            communicator2.SetProperty("ForwarderAdapter.Endpoints", GetTestEndpoint(3));
            communicator2.SetProperty("ForwarderAdapter.IncomingFrameMaxSize", "0");
            ObjectAdapter forwarderAdapter = communicator2.CreateObjectAdapter("ForwarderAdapter");

            forwarderAdapter.Add("forwarder", new Forwarder(IObjectPrx.Parse(GetTestProxy("thrower"), communicator2)));
            await forwarderAdapter.ActivateAsync();

            ServerReady();
            await Communicator.ShutdownComplete;
        }