Multi-threading with .Net HttpListener

后端 未结 5 1577
盖世英雄少女心
盖世英雄少女心 2020-12-02 07:33

I have a listener:

listener = new HttpListener();
listener.Prefixes.Add(@\"http://+:8077/\");
listener.Start();
listenerThread = new Thread(HandleRequests);
         


        
5条回答
  •  甜味超标
    2020-12-02 08:26

    Simply calling listener.Stop() should do the trick. This will not terminate any connections that have already been established but will prevent any new connections.

提交回复
热议问题