<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 async def _run_server_task(self, started_signal):
 """Create a BackgroundTask to manage the server. This allows subclasess to attach their server related tasks as subtasks that are properly cleaned up when this parent task is stopped and not require them all to overload start() and stop() to perform this action. """


        try:
            server = await websockets.serve(self._manage_connection, self.host, self.port)
            port = server.sockets[0].getsockname()[1]
            started_signal.set_result(port)
        except Exception as err:
            self._logger.exception("Error starting server on host %s, port %s", self.host, self.port)
            started_signal.set_exception(err)
            return

        try:
            while True:
                await asyncio.sleep(1)
        except asyncio.CancelledError:
            self._logger.info("Stopping server due to stop() command")
        finally:
            server.close()
            await server.wait_closed()

        self._logger.debug("Server stopped, exiting task")