예제 #1
0
 public Listener(TcpServerConfig config, ServerEndPoint serverEndPoint, ILoger loger)
 {
     this.config        = config;
     this.server        = new AsyncServer(config.MaxBufferPoolSize, config.BufferSize, config.MaxConnections, loger);
     this.server.Name   = serverEndPoint.Name;
     this.localEndPoint = new IPEndPoint(IPAddress.Parse(serverEndPoint.IP), serverEndPoint.Port);
 }
예제 #2
0
파일: Listener.cs 프로젝트: liwl/sunsocket
 public Listener(TcpServerConfig config, ServerEndPoint serverEndPoint,ILoger loger)
 {
     this.config = config;
     this.server = new AsyncServer(config.MaxBufferPoolSize,config.BufferSize,config.MaxConnections,loger);
     this.server.Name = serverEndPoint.Name;
     this.localEndPoint = new IPEndPoint(IPAddress.Parse(serverEndPoint.IP), serverEndPoint.Port);
 }
예제 #3
0
파일: Program.cs 프로젝트: liwl/sunsocket
 static void Main(string[] args)
 {
     var loger = new Loger();
     var config = new TcpServerConfig();
     config.BufferSize = 1024 * 4;
     config.MaxConnections = 100000;
     Framework.Listener listener = new Framework.Listener(config,new ServerEndPoint() {Name="one",IP="127.0.0.1",Port=9989 }, loger);
     listener.AsyncServer.OnReceived += ReceiveCommond;
     listener.Start();
     Framework.Listener listenerOne = new Framework.Listener(config, new ServerEndPoint() { Name = "one", IP = "127.0.0.1", Port = 9988 }, loger);
     listenerOne.AsyncServer.OnReceived += ReceiveCommond;
     listenerOne.Start();
     Console.WriteLine("服务器已启动");
     Console.ReadLine();
 }