Example #1
0
        public static void MainBase(string _identify)
        {
            if (IsStartBase == true)
            {
                return;
            }
            IsStartBase = true;//设置为开启

            //SetUpPluginUpgrade();

            IsRootMNode = HostSettingConfig.GetValue("rootmnode") == "1" ? true : false;
            IsDebug     = HostSettingConfig.GetValue("debug") == "1" ? true : false;
            Identify    = _identify;
            HostName    = HostSettingConfig.GetValue("hostname");

            IsCompressJson   = HostSettingConfig.GetValue("compress") == "1" ? true : false;
            IsEncryptionJson = HostSettingConfig.GetValue("encryption") == "1" ? true : false;
            serializeType    = (SerializeType)Convert.ToInt32(HostSettingConfig.GetValue("serializetype"));
            IsOverTime       = HostSettingConfig.GetValue("overtime") == "1" ? true : false;
            OverTime         = Convert.ToInt32(HostSettingConfig.GetValue("overtimetime"));
            IsToken          = HostSettingConfig.GetValue("token") == "1" ? true : false;
            MongoConnStr     = HostSettingConfig.GetValue("mongodb_conn");



            WcfGlobal.Run(StartType.BaseService);
            WcfGlobal.Run(StartType.FileService);
            WcfGlobal.Run(StartType.HttpService);
            WcfGlobal.Run(StartType.SuperClient);
            WcfGlobal.Run(StartType.MiddlewareTask); //定时任务

            CoreFrame.SSO.SsoHelper.Start();         //单点登录启动

            GetAllConfig();                          //获取所有配置
        }
Example #2
0
        public static void ExitRoute()
        {
            if (IsStartRoute == false)
            {
                return;
            }
            IsStartRoute = false;//设置为开启

            WcfGlobal.Quit(StartType.RouterBaseService);
            WcfGlobal.Quit(StartType.RouterFileService);
        }
Example #3
0
        public static void MainRoute()
        {
            if (IsStartRoute == true)
            {
                return;
            }
            IsStartRoute = true;//设置为开启

            WcfGlobal.Run(StartType.RouterBaseService);
            WcfGlobal.Run(StartType.RouterFileService);
        }
Example #4
0
 public static void Exit()
 {
     WcfGlobal.Quit(StartType.PublishService);
     WcfGlobal.Quit(StartType.MiddlewareTask);
     WcfGlobal.Quit(StartType.SuperClient);
     WcfGlobal.Quit(StartType.BaseService);
     WcfGlobal.Quit(StartType.FileService);
     WcfGlobal.Quit(StartType.RouterBaseService);
     WcfGlobal.Quit(StartType.RouterFileService);
     WcfGlobal.Quit(StartType.MongoDB);
     WcfGlobal.Quit(StartType.Nginx);
 }
Example #5
0
        public static void ExitBase()
        {
            if (IsStartBase == false)
            {
                return;
            }
            IsStartBase = false;//设置为开启

            MiddlewareLogHelper.WriterLog(LogType.MidLog, true, Color.Red, "正在准备关闭中间件服务,请等待...");
            ClientLinkManage.UnAllConnection();//关闭所有连接

            WcfGlobal.Quit(StartType.MiddlewareTask);
            WcfGlobal.Quit(StartType.SuperClient);
            WcfGlobal.Quit(StartType.BaseService);
            WcfGlobal.Quit(StartType.FileService);
            WcfGlobal.Quit(StartType.HttpService);
        }
Example #6
0
        public static void Main()
        {
            IsDebug      = HostSettingConfig.GetValue("debug") == "1" ? true : false;
            HostName     = HostSettingConfig.GetValue("hostname");
            IsToken      = HostSettingConfig.GetValue("token") == "1" ? true : false;
            MongoConnStr = HostSettingConfig.GetValue("mongodb_conn");

            WcfGlobal.Run(StartType.KillAllProcess);
            if (Convert.ToInt32(HostSettingConfig.GetValue("wcfservice")) == 1)
            {
                WcfGlobal.Run(StartType.BaseService);
            }
            if (Convert.ToInt32(HostSettingConfig.GetValue("filetransfer")) == 1)
            {
                WcfGlobal.Run(StartType.FileService);
            }

            if (Convert.ToInt32(HostSettingConfig.GetValue("router")) == 1)
            {
                WcfGlobal.Run(StartType.RouterBaseService);
                WcfGlobal.Run(StartType.RouterFileService);
            }

            WcfGlobal.Run(StartType.SuperClient);

            if (Convert.ToInt32(HostSettingConfig.GetValue("mongodb")) == 1)
            {
                WcfGlobal.Run(StartType.MongoDB);
            }

            if (Convert.ToInt32(HostSettingConfig.GetValue("timingtask")) == 1)
            {
                WcfGlobal.Run(StartType.MiddlewareTask);
            }

            WcfGlobal.Run(StartType.PublishService);
            if (Convert.ToInt32(HostSettingConfig.GetValue("nginx")) == 1)
            {
                WcfGlobal.Run(StartType.Nginx);
            }
        }