It is required to process requests from the network not by a third-party web server, but by the desktop application that clients will send.
There is no problem with the server, because .Net has HttpListener and HttpServer , with their help a simple http server is made, like the creation of a web server .

But, the problem is that while the server listens to connections, the rest of the application does not load, and this is understandable, it also listens in an infinite loop, then the code does not execute.

The question is - how to implement the work of the http-server so that the desktop application does not lose functionality? Maybe there is a ready built-in web-server?

  • one
    you can for example run in a separate thread - Grundy
  • I 'll try, thank you) - BlackOverlord

1 answer 1

Run the server in a separate thread

 Thread ServerThread = new Thread(new ThreadStart(StartServer));