/// <summary>实例化增强UDP</summary> public UdpServer() { Local.Type = NetType.Udp; Remote.Type = NetType.Udp; _Sessions = new SessionCollection(this); StatSession = new Statistics(); SessionTimeout = Setting.Current.SessionTimeout; }
/// <summary>实例化增强UDP</summary> public UdpServer() { SessionTimeout = 30; Local = new NetUri(ProtocolType.Udp, IPAddress.Any, 0); Remote.ProtocolType = ProtocolType.Udp; _Sessions = new SessionCollection(this); StatSession = new Statistics(); }
/// <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); Log = Logger.Null; }
/// <summary>实例化增强UDP</summary> public UdpServer() { //SessionTimeout = 30; Local = new NetUri(NetType.Udp, IPAddress.Any, 0); Remote.Type = NetType.Udp; _Sessions = new SessionCollection(this); StatSession = new Statistics(); //PacketQueue = new DefaultPacketQueue(); }
/// <summary>实例化增强UDP</summary> public UdpServer() { SessionTimeout = 30; // Udp服务器不能关闭自己,但是要关闭会话 // Udp客户端一般不关闭自己 //EnableReset = false; Local = new NetUri(NetType.Udp, IPAddress.Any, 0); Remote.Type = NetType.Udp; _Sessions = new SessionCollection(this); StatSession = new Statistics(); }
/// <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; }
private void CloseAllSession() { var sessions = _Sessions; if (sessions != null) { _Sessions = null; if (sessions.Count > 0) { WriteLog("准备释放会话{0}个!", sessions.Count); sessions.TryDispose(); sessions.Clear(); } } }
/// <summary>构造TCP服务器对象</summary> public TcpServer() { Name = this.GetType().Name; Local = new NetUri(ProtocolType.Tcp, IPAddress.Any, 0); SessionTimeout = 30; AutoReceiveAsync = true; UseProcessAsync = true; _Sessions = new SessionCollection(this); StatSession = new Statistics(); StatSend = new Statistics(); StatReceive = new Statistics(); Log = Logger.Null; }
/// <summary>实例化增强UDP</summary> public UdpServer() { Local.Type = NetType.Udp; Remote.Type = NetType.Udp; _Sessions = new SessionCollection(this); SessionTimeout = Setting.Current.SessionTimeout; // 处理UDP最大并发接收 MaxAsync = Environment.ProcessorCount * 16 / 10; if (Setting.Current.Debug) { Log = XTrace.Log; } }
/// <summary>构造TCP服务器对象</summary> public TcpServer() { Name = GetType().Name; Local = new NetUri(NetType.Tcp, IPAddress.Any, 0); SessionTimeout = 30; AutoReceiveAsync = true; UseProcessAsync = true; MaxAsync = Environment.ProcessorCount * 16 / 10; _Sessions = new SessionCollection(this); StatSession = new Statistics(); StatSend = new Statistics(); StatReceive = new Statistics(); Log = Logger.Null; }