How to stop a lNet Server listening? lazarus / 38-Networking and Web Programming ---------------------------------------------------------------------- Niri · 2011-07-06 17:51 Hi, i have played around a bit with the lNet http server an have managed to extend my monitoring application to send an xml document via http. That works so far. Because this should be just an additional option the http server should not work all the time but can be switched on and off. I start listening to incoming connections with the method "listen". But i did not find a method so stop listening. Is there a method and do i simply have overseen it? Or do i have to do another trick to stop the server without stopping the whole application? Thanks for a hint! Niri ---------------------------------------------------------------------- Niri · 2011-07-06 20:00 OKay, i have tested a little bit and it seems that the disconnect method does what i want. It cuts off the server connection and is able to be reconnected by the listen method used again. I think my confusion was due to the socket also has a disconnect method that is called after each request. But these are obviously different things. ---------------------------------------------------------------------- Dibo · 2011-07-06 22:10 You could create http server in runtime (for example in form create event) Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i type  TForm1 = class(TForm)  procedure Form1Create(Sender: TObject);  private    FHttpServer: TLHTTPServerComponent;end; procedure TForm.OnCreate(Sender: TObject);begin  FHttpServer := TLHTTPServerComponent.Create(Self);  FHttpServer.Listen(some_port);end; And if you want stop listening, just destroy this object calling FHttpServer.Free and recreate if you want listen again ---------------------------------------------------------------------- Niri · 2011-07-08 21:28 A good idea, thanks!