def run(portId): try: server_address = ('localhost', portId) server = HTTPServer(server_address, requesthandlerclass) server.serve_forever() except KeyboardInterrupt: print("you interupted the code") server.close_request()
def close_request(self, request): if (request is None): return HTTPServer.close_request(self, request)