示例#1
0
 /// <summary>
 ///     初始化
 /// </summary>
 public static void Initialize()
 {
     RpcEnvironment.CurrentFlow = RpcFlowType.GlobalInitializing;
     GlobalsFuturesOption.ReigsterEntityType();
     RpcCore.Run();
     RpcEnvironment.CurrentFlow = RpcFlowType.GlobalInitialized;
 }
示例#2
0
 /// <summary>
 ///     启动
 /// </summary>
 public static void Run()
 {
     if (Singleton != null)
     {
         ShutDown();
     }
     Singleton = new RpcCore();
     Singleton.init_net_command();
     Singleton.start_net_command();
 }
示例#3
0
        /// <summary>
        ///     执行销毁时
        /// </summary>
        public static void Destroy()
        {
            RpcEnvironment.CurrentFlow = RpcFlowType.Exiting;
            var cnt = 0;

            while (RpcEnvironment.CurrentFlow == RpcFlowType.Exiting && cnt++ < 30)
            {
                Thread.Sleep(100);
            }
            RpcCore.ShutDown();
            RpcEnvironment.ClearCacheCommand();
            RpcEnvironment.CurrentFlow = RpcFlowType.Destroied;
        }