Пример #1
0
        private const string ServerUrl    = "http://localhost:9000/"; //监听端口9000的地址
        public static void Main(string[] args)
        {
            var server = new WebServer(concurrentCount);

            RegisterMiddleware(server);
            server.Bind(ServerUrl); //本质上是监听  --bind 对端口做监听
            server.Start();
            Console.WriteLine($"Web server started at {ServerUrl}. Press any key to exist...");
            Console.ReadKey();
        }