code: def _shutdown(self):
          
          for exit_handler in self._exit_handlers:
              exit_handler()
  
          if self._socket:
              self._socket.close()
              self._socket = None
docs: Shut down the server.