/// <summary> /// Stop the WebServer /// </summary> private void StopWebServer() { try { _webServer.Stop(); UpdateFormState_WebServerRunning(); } catch (Exception caught) { logger.Error("Unexpected Error Stopping WebServer", caught); MessageBox.Show("An Unexpected Error has occurred while attempting to stop the webserver." + " Review Logs for more information ", "Crown of the Gods - WebServer Error", MessageBoxButtons.OK, MessageBoxIcon.Error, MessageBoxDefaultButton.Button1); } }
public static void runServer() { string srv; if (Config.LocalhostOnly) { srv = "localhost"; } else { srv = "+"; } WebServer.WebServer ws = new WebServer.WebServer(SendResponse, string.Format("http://{0}:{1}/", srv, Config.Port)); ws.Run(); Console.WriteLine("Akira webserver. Press any key to quit."); Console.ReadKey(); ws.Stop(); }