Esempio n. 1
0
        public LogInfo(MesServer server, LogLevel logLevel, string msg)
        {
            BaseInfo(logLevel, msg);
            localAddress     = "server";
            localPort        = "";
            localDeviceName  = "server";
            remoteAddress    = "";
            remotePort       = "";
            remoteDeviceName = "-/-";

            ILog iLog = server.Logger;

            WriteLog(iLog, logLevel);
        }
Esempio n. 2
0
        private void pOPStartServerBackWork()
        {
            LoadFinish = false;
            if (m_Bootstrap == null)
            {
                MessageUtilSkin.ShowTips("数据服务器配置加载错误,请检查服务器IP,端口是否设置正确。");
                return;
            }

            StartResult startResult = m_Bootstrap.Start();

            if (startResult == StartResult.Success)
            {
                mesServer = m_Bootstrap.AppServers.Cast <MesServer>().FirstOrDefault();
            }
            else
            {
                mesServer = null;
            }
        }
Esempio n. 3
0
 /// <summary>
 /// 初始化服务器
 /// </summary>
 private void SetupAppServer()
 {
     if (mesServer == null)
     {
         //方法一、采用当前应用程序中的【App.config】文件。
         var bootstrap = BootstrapFactory.CreateBootstrap();
         if (!bootstrap.Initialize())
         {
             txtMsg.AppendText(DateTime.Now + ">> 初始化服务器失败" + Environment.NewLine);
             return;
         }
         StartResult startResult = bootstrap.Start();
         if (startResult == StartResult.Success)
         {
             txtMsg.AppendText(DateTime.Now + ">> 初始化服务器" + Environment.NewLine);
             mesServer = bootstrap.AppServers.Cast <MesServer>().FirstOrDefault();
             mesServer.Stop();
         }
         else
         {
             txtMsg.AppendText(DateTime.Now + ">> 初始化服务器失败" + Environment.NewLine);
         }
     }
 }