Beispiel #1
0
 //构造函数
 public TcpServer(TcpServerConfig config)
 {
     this.Config                = config;
     endPoint                   = new IPEndPoint(IPAddress.Parse(config.IP), config.Port);
     this.sessionPool           = new TcpSessionPool();
     this.sessionPool.TcpServer = this;
     this.Loger                 = GetLoger();
 }
Beispiel #2
0
 //构造函数
 public TcpServer(TcpServerConfig config, ILoger loger)
 {
     this.Config = config;
     endPoint = new IPEndPoint(IPAddress.Parse(config.IP), config.Port);
     this.sessionPool = new TcpSessionPool();
     this.sessionPool.TcpServer = this;
     this.Loger = loger;
 }
Beispiel #3
0
 //构造函数
 public AsyncServer(int bufferPoolSize, int bufferSize, int maxConnections, ILoger loger)
 {
     this.sessionPool = new TcpSessionPool(bufferPoolSize, bufferSize, maxConnections, loger);
     this.OnlineList  = new ConcurrentDictionary <string, ITcpSession>();
     this.loger       = loger;
 }
Beispiel #4
0
 //构造函数
 public AsyncServer(int bufferPoolSize, int bufferSize, int maxConnections,ILoger loger)
 {
     this.sessionPool = new TcpSessionPool(bufferPoolSize,bufferSize,maxConnections,loger);
     this.OnlineList = new ConcurrentDictionary<string, ITcpSession>();
     this.loger = loger;
 }