code: async def _manage_connection(self):
          
  
          try:
              while True:
                  message = await self._con.recv()
  
                  try:
                      unpacked = unpack(message)
                  except Exception:  # pylint:disable=broad-except;This is a background worker
                      self._logger.exception("Corrupt message received")
                      continue
  
                  if not VALID_SERVER_MESSAGE.matches(unpacked):
                      self._logger.warning("Dropping invalid message from server: %s", unpacked)
                      continue
  
                  # Don't block until all callbacks have finished since once of
                  # those callbacks may call self.send_command, which would deadlock
                  # since it couldn't get the response until it had already finished.
                  if not await self._manager.process_message(unpacked, wait=False):
                      self._logger.warning("No handler found for received message, message=%s", unpacked)
          except asyncio.CancelledError:
              self._logger.info("Closing connection to server due to stop()")
          finally:
              await self._manager.process_message(dict(type='event', name=self.DISCONNECT_EVENT, payload=None))
              await self._con.close()
docs: Internal coroutine for managing the client connection.