示例#1
0
        static void Main(string[] args)
        {
            var loger  = new Loger();
            var config = new TcpServerConfig();

            config.BufferSize     = 1024 * 4;
            config.MaxConnections = 40000;
            Framework.Listener listener = new Framework.Listener(config, new ServerEndPoint()
            {
                Name = "one", IP = "127.0.0.1", Port = 8088
            }, 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();
        }
示例#2
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();
 }