I have a listener:
listener = new HttpListener(); listener.Prefixes.Add(@\"http://+:8077/\"); listener.Start(); listenerThread = new Thread(HandleRequests);
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.