示例#1
0
文件: Server.cs 项目: RedTaylor/ice
        public override async Task RunAsync(string[] args)
        {
            string pluginPath =
                string.Format("msbuild/plugin/{0}/Plugin.dll",
                              Path.GetFileName(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location)));

            await using Communicator communicator = Initialize(
                            ref args,
                            new Dictionary <string, string>()
            {
                {
                    "Ice.Plugin.DispatchPlugin",
                    $"{pluginPath}:ZeroC.Ice.Test.Interceptor.DispatchPluginFactory"
                }
            });

            await communicator.ActivateAsync();

            communicator.SetProperty("TestAdapter.Endpoints", GetTestEndpoint(0));
            ObjectAdapter adapter = communicator.CreateObjectAdapter("TestAdapter");

            adapter.Add("test", new MyObject());
            await DispatchInterceptors.ActivateAsync(adapter);

            ServerReady();
            await communicator.WaitForShutdownAsync();
        }
示例#2
0
文件: ServerAMD.cs 项目: mreinart/ice
        public override async Task RunAsync(string[] args)
        {
            await Communicator.ActivateAsync();

            Communicator.SetProperty("TestAdapter.Endpoints", GetTestEndpoint(0));
            ObjectAdapter adapter = Communicator.CreateObjectAdapter("TestAdapter");

            adapter.Add("test", new AsyncMyObject());
            await DispatchInterceptors.ActivateAsync(adapter);

            ServerReady();
            await Communicator.ShutdownComplete;
        }