예제 #1
0
 static void Main(string[] args)
 {
     TcpServerConfig configOne = new TcpServerConfig { ServerId=1,Name = "one", IP = "127.0.0.1", Port = 8088,BufferSize = 1024,MaxFixedBufferPoolSize=1024*4, MaxConnections = 8000 };
     MyServer listener = new MyServer(configOne, loger);
     listener.Start();
     MonitorConfig monitorConfig = new MonitorConfig();
     monitorConfig.WorkDelayMilliseconds = 10000;
     monitorConfig.TimeoutMilliseconds = 10000;
     MyMonitor monitor = new MyMonitor(monitorConfig,3000);
     monitor.AddServer(listener);
     monitor.Start();
     Console.WriteLine("服务器已启动");
     Console.ReadLine();
 }
예제 #2
0
        static void Main(string[] args)
        {
            TcpServerConfig configOne = new TcpServerConfig {
                ServerId = 1, Name = "one", IP = "127.0.0.1", Port = 8088, BufferSize = 1024, MaxFixedBufferPoolSize = 1024 * 4, MaxConnections = 8000
            };
            MyServer listener = new MyServer(configOne, loger);

            listener.Start();
            MonitorConfig monitorConfig = new MonitorConfig();

            monitorConfig.WorkDelayMilliseconds = 10000;
            monitorConfig.TimeoutMilliseconds   = 10000;
            MyMonitor monitor = new MyMonitor(monitorConfig, 3000);

            monitor.AddServer(listener);
            monitor.Start();
            Console.WriteLine("服务器已启动");
            Console.ReadLine();
        }