Beispiel #1
0
        public static void Main(string[] args)
        {
            (bool isSuccess, CommandLineOptions options) = ConsoleLineArgumentsParser.ParseArguments(args);

            if (isSuccess)
            {
                AsyncEngine.SocketEngine = CreateAsyncEngine(options);

                if (options.Platform == true)
                {
                    PlatformBenchmarks.Program.PlatformMain(args, options);
                }
                else if (options.RawSocket == true)
                {
                    if (options.SocketEngine == SocketEngineType.DefaultTransport)
                    {
                        var handler = new SystemNetSocketHandler();
                        var host    = new RawSocketHost <Socket, SocketAsyncEventArgs, SystemNetSocketHandler>(options, args, handler);
                        host.Run();
                    }
                    else
                    {
                        var handler = new TmdsSocketHandler();
                        var host    = new RawSocketHost <Tmds.LinuxAsync.Socket, Tmds.LinuxAsync.SocketAsyncEventArgs, TmdsSocketHandler>(options, args, handler);
                        host.Run();
                    }
                }
                else
                {
                    KestrelHost host = new KestrelHost(options, args);
                    host.Run();
                }
            }
        }
Beispiel #2
0
        public static void Main(string[] args)
        {
            (bool isSuccess, CommandLineOptions options) = ConsoleLineArgumentsParser.ParseArguments(args);

            if (isSuccess)
            {
                CreateHostBuilder(args, options).Build().Run();
            }
        }