Ejemplo n.º 1
0
 public static int Main(string[] args)
 {
     try
     {
         Task task1 = IceService.StartService(args);
         Task task2 = gRPCService.StartService(args);
         Task.WaitAll(new Task[] { task1, task2 });
         // task2.Wait();
         // Console.ReadKey();
     }
     catch (Exception e)
     {
         Console.Error.WriteLine(e);
         return(1);
     }
     return(0);
 }
Ejemplo n.º 2
0
        public async static Task StartService(string[] args)
        {
            Console.WriteLine("StartIceServer");
            await Task.Yield();

            var config = Config.IceAdapterConfig.Config;

            Console.WriteLine($"IceServer.name = \"{config.name}\"");
            using (Ice.Communicator communicator = Ice.Util.initialize(ref args))
                using (IceService iceService = new IceService())
                {
                    iceService.start(config.name, communicator, args);
                    Console.WriteLine("Ice server listening");
                    await iceService.client.Connect(args);

                    await Task.Factory.StartNew(() =>
                    {
                        communicator.waitForShutdown();
                    });
                }
        }