123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115 |
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading;
- using SuperSocket.Common;
- using System.Collections.Specialized;
- using System.Configuration;
- namespace SuperSocket.SocketBase.Config
- {
-
-
-
- [Serializable]
- public partial class RootConfig : IRootConfig
- {
-
-
-
-
- public RootConfig(IRootConfig rootConfig)
- {
- rootConfig.CopyPropertiesTo(this);
- this.OptionElements = rootConfig.OptionElements;
- }
-
-
-
- public RootConfig()
- {
- int maxWorkingThread, maxCompletionPortThreads;
- ThreadPool.GetMaxThreads(out maxWorkingThread, out maxCompletionPortThreads);
- MaxWorkingThreads = maxWorkingThread;
- MaxCompletionPortThreads = maxCompletionPortThreads;
- int minWorkingThread, minCompletionPortThreads;
- ThreadPool.GetMinThreads(out minWorkingThread, out minCompletionPortThreads);
- MinWorkingThreads = minWorkingThread;
- MinCompletionPortThreads = minCompletionPortThreads;
- PerformanceDataCollectInterval = 60;
- Isolation = IsolationMode.None;
- }
- #region IRootConfig Members
-
-
-
- public int MaxWorkingThreads { get; set; }
-
-
-
- public int MinWorkingThreads { get; set; }
-
-
-
- public int MaxCompletionPortThreads { get; set; }
-
-
-
- public int MinCompletionPortThreads { get; set; }
-
-
-
- public int PerformanceDataCollectInterval { get; set; }
-
-
-
-
-
-
- public bool DisablePerformanceDataCollector { get; set; }
-
-
-
- public IsolationMode Isolation { get; set; }
-
-
-
-
-
-
- public string LogFactory { get; set; }
-
-
-
- public NameValueCollection OptionElements { get; set; }
-
-
-
-
-
-
- public virtual TConfig GetChildConfig<TConfig>(string childConfigName)
- where TConfig : ConfigurationElement, new()
- {
- return this.OptionElements.GetChildConfig<TConfig>(childConfigName);
- }
- #endregion
- }
- }
|