static void Main(string[] args) { string endpoint = "http://localhost:8080/test/"; Webserver ws = new Webserver(SendResponse, endpoint); ws.Run(); Console.WriteLine($"Simple WebServer, running at: {endpoint} - press any key to stop"); Console.ReadKey(); ws.Stop(); thingTest("thing"); }
static void Main(string[] args) { string endpoint = "http://localhost:8080/test/"; Webserver ws = new Webserver(SendResponse, endpoint); ws.Run(); Console.WriteLine($"Simple WebServer, running at: {endpoint} - press any key to stop"); Console.ReadKey(); ws.Stop(); //End goal is to pass method and endpoint here //PostServer ps = new PostServer(); //Console.WriteLine($"Simple WebServer, running - press any key to stop"); //Console.ReadKey(); }
private void runbttn_Click(object sender, EventArgs e) { if (runbttn.Text.Equals("Start")) { _Server = new Webserver(this); _Server.Run(); runbttn.Text = "Stop"; } else { Webserver.KeepListening = false; // SEND REQUEST TO SERVER TO SHUTDOWN Console.ForegroundColor = ConsoleColor.Yellow; Console.WriteLine("[*] APPLICATION: SHUTTING_DOWN"); TcpClient _ExitClient = new TcpClient("192.168.0.215", _Server.IPeP.Port); _Server = null; runbttn.Text = "Start"; } }