I wrote my two classes
class RequestHandler(http.server.SimpleHTTPRequestHandler):
class Server(socketserver.TCPServer):
so that an unique Server can handle regular browser-, ajax- and websocket requests. It works fine.
I just can't find the way to terminate the Server. So I kill the process.
[EDIT] I need to shutdown the server when it receives a shutdown request from the browser. I tried setting self.__shutdown_request
True but it didn't work.
Beside, after I have closed the browser and killed the process, netstat tells me there are some sockets still alive using the Server's port, with TIME_WAIT status. So I have to wait for them to die before to use the same port again.
How do I terminate the Server?
Is there a way to remove those sockets?