Start() 공개 메소드

Starts the instance of the ASP.Net server.
public Start ( ) : void
리턴 void
예제 #1
0
파일: Program.cs 프로젝트: Cayan-LLC/netty
        /// <summary>
        ///     Defines the entry point of the application.
        /// </summary>
        /// <param name="args">The command-line arguments passed to the application.</param>
        public static int Main(string[] args)
        {
            var options = new Options();
            if (!CommandLine.Parser.Default.ParseArguments(args, options))
            {
                return -1;
            }

            Console.Write("Starting Web Server ... ");

            int port = options.Port;
            if (port == -1)
            {
                port = NetworkUtility.FindRandomOpenPort();
            }

            var webServer = new NettyServer(options.PhysicalPath, options.VirtualPath, port);

            // Update an application setting, and then start the server
            webServer.Start();

            Console.WriteLine("Done.");
            Console.WriteLine("Listening at: {0}", webServer.Port);
            Console.WriteLine("Press [ENTER] to exit.");

            Console.ReadLine();

            // Stop the web server - this will restore the configuration to the original values
            Console.WriteLine("Stopping Web Server ... ");

            webServer.Stop();

            return 0;
        }
예제 #2
0
 public static void Startup()
 {
     _webServer = new NettyServer(@"..\..\..\SampleWebSite", "/", 9015);
     _webServer.Start();
 }