public static void StartServer() { if (Instance?.IsRunning >= 0) { return; } m_instance = new CenterServer(new CenterServerConfig()); if (Instance.Start() == false) { Instance.Stop(); Instance.IsRunning = -1; } return; }
public static void CreateInstance(CenterServerConfig config) { if (CenterServer.Instance != null) { return; } FileInfo fileInfo = new FileInfo(config.LogConfigFile); if (!fileInfo.Exists) { ResourceUtil.ExtractResource(fileInfo.Name, fileInfo.FullName, Assembly.GetAssembly(typeof(CenterServer))); } XmlConfigurator.ConfigureAndWatch(fileInfo); CenterServer._instance = new CenterServer(config); }
public static void CreateInstance(CenterServerConfig config) { //Only one intance if (Instance != null) { return; } FileInfo logConfig = new FileInfo(config.LogConfigFile); if (!logConfig.Exists) { ResourceUtil.ExtractResource(logConfig.Name, logConfig.FullName, Assembly.GetAssembly(typeof(CenterServer))); } //Configure and watch the config file XmlConfigurator.ConfigureAndWatch(logConfig); //Create the instance _instance = new CenterServer(config); }
public static void CreateInstance(CenterServerConfig config) { //Only one intance if (Instance != null) return; FileInfo logConfig = new FileInfo(config.LogConfigFile); if (!logConfig.Exists) { ResourceUtil.ExtractResource(logConfig.Name, logConfig.FullName, Assembly.GetAssembly(typeof(CenterServer))); } //Configure and watch the config file XmlConfigurator.ConfigureAndWatch(logConfig); //Create the instance _instance = new CenterServer(config); }
public ServerClient(CenterServer svr) : base(new byte[8192], new byte[8192]) { this._svr = svr; }
/// <summary> /// 构造函数 /// </summary> public ServerClient(CenterServer svr) : base(new byte[2048], new byte[2048]) { _svr = svr; }