/// <summary>构造TCP服务器对象</summary> public TcpServer() { Name = GetType().Name; Local = new NetUri(NetType.Tcp, IPAddress.Any, 0); SessionTimeout = Setting.Current.SessionTimeout; MaxAsync = Environment.ProcessorCount * 16 / 10; _Sessions = new SessionCollection(this); if (Setting.Current.Debug) { Log = XTrace.Log; } }
/// <summary>实例化增强UDP</summary> public UdpServer() { Local.Type = NetType.Udp; Remote.Type = NetType.Udp; _Sessions = new SessionCollection(this); //StatSession = new PerfCounter(); SessionTimeout = Setting.Current.SessionTimeout; // 处理UDP最大并发接收 MaxAsync = Environment.ProcessorCount * 16 / 10; ProcessAsync = true; if (Setting.Current.Debug) { Log = XTrace.Log; } }