Start() public method

Starts the instance of the ASP.Net server.
public Start ( ) : void
return 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();
 }