async def METHOD_NAME(self, request):
    """Message handler for inbound messages.
    Args:
        request: aiohttp request object
    Returns:
        The web response
    """
    ws = web.WebSocketResponse(
        autoping=True,
        heartbeat=self.heartbeat_interval,
        receive_timeout=self.timout_interval,
    )
    await ws.prepare(request)
    loop = asyncio.get_event_loop()
    client_info = {"host": request.host, "remote": request.remote}
    session = await self.create_session(
        accept_undelivered=True, can_respond=True, client_info=client_info
    )
    async with session:
        inbound = loop.create_task(ws.receive())
        outbound = loop.create_task(session.wait_response())
        while not ws.closed:
            await asyncio.wait(
                (inbound, outbound), return_when=asyncio.FIRST_COMPLETED
            )
            if inbound.done():
                msg: WSMessage = inbound.result()
                LOGGER.info("Websocket received message: %s", msg.data)
                if msg.type in (WSMsgType.TEXT, WSMsgType.BINARY):
                    try:
                        await session.receive(msg.data)
                    except (MessageParseError, WireFormatParseError):
                        await ws.close(1003)  # unsupported data error
                elif msg.type == WSMsgType.ERROR:
                    LOGGER.error(
                        "Websocket connection closed with exception: %s",
                        ws.exception(),
                    )
                else:
                    LOGGER.error(
                        "Unexpected Websocket message type received: %s: %s, %s",
                        msg.type,
                        msg.data,
                        msg.extra,
                    )
                if not ws.closed:
                    inbound = loop.create_task(ws.receive())
            if outbound.done() and not ws.closed:
                # response would be None if session was closed
                response = outbound.result()
                if isinstance(response, bytes):
                    await ws.send_bytes(response)
                else:
                    await ws.send_str(response)
                session.clear_response()
                outbound = loop.create_task(session.wait_response())
    if inbound and not inbound.done():
        inbound.cancel()
    if outbound and not outbound.done():
        outbound.cancel()
    if not ws.closed:
        await ws.close()
    LOGGER.info("Websocket connection closed")
    return ws