static void Main(string[] args) { var host = new WebHostBuilder() .UseUrls($"http://{ServerConfSetting.serverSettingModel.Server.ip}:{ServerConfSetting.serverSettingModel.Web.port}") .UseKestrel() .UseContentRoot(Directory.GetCurrentDirectory()) .UseStartup <Startup>() .Build(); var boot = new RatelServerBoot(); boot.RUN(); host.Run(); boot.Close(); }
public void Stop() { thread.Interrupt(); boot.Close(); host.StopAsync().Wait(); }