'Stops the serve_forever loop.
Blocks until the loop has finished. This must be called while
serve_forever() is running in another thread, or it will
deadlock.'

def shutdown(self):

    self.__shutdown_request = True
    self.__is_shut_down.wait()
