Exemplo n.º 1
0
        static void Main(string[] args)
        {
            var localActor = new RpcActor();

            localActor.Register <IHelloService>(new HelloService());
            localActor.Register <ICalcService>(new CalcService());
            localActor.Register <IOrderService>(new OrderService());

            localActor.Bootup();

            while (true)
            {
                try
                {
                    string text = Console.ReadLine().ToLowerInvariant();
                    if (text == "quit" || text == "exit")
                    {
                        break;
                    }
                    else if (text == "reconnect")
                    {
                        localActor.Shutdown();
                        localActor.Bootup();
                    }
                    else
                    {
                        _log.WarnFormat("Cannot parse the operation for input [{0}].", text);
                    }
                }
                catch (Exception ex)
                {
                    _log.Error(ex.Message, ex);
                }
            }

            localActor.Shutdown();
        }