code: def shutdown_mp(self, clean=True):
          
          # The server runs on a worker thread, so we need to shut it down first.
          if hasattr(self, 'server'):
              # Shutdown the server quickly.
              try:
                  # For some strange reason, this throws an OSError on windows.
                  self.server.socket.shutdown(socket.SHUT_RDWR)
              except OSError:
                  pass
              self.server.socket.close()
              self.server.shutdown()
          if hasattr(self, 'handler'):
              self.handler.workers.stop_workers(clean)
docs: Shutdown all the multiprocessing.
  
          :param bool clean: Whether to shutdown things cleanly, or force a quick and dirty shutdown.