def METHOD_NAME(listener: WebsocketListenerRouteHandler) -> Callable[[WebSocket], Coroutine[Any, None, None]]:
    if data_dto := listener.resolve_data_dto():
        async def handle_receive(socket: WebSocket) -> Any:
            received_data = await socket.receive_data(mode=listener._receive_mode)
            return data_dto(socket).decode_bytes(
                received_data.encode("utf-8") if isinstance(received_data, str) else received_data
            )
    elif listener.parsed_data_field and listener.parsed_data_field.annotation is str:
        async def handle_receive(socket: WebSocket) -> Any:
            received_data = await socket.receive_data(mode=listener._receive_mode)
            return received_data.decode("utf-8") if isinstance(received_data, bytes) else received_data
    elif listener.parsed_data_field and listener.parsed_data_field.annotation is bytes:
        async def handle_receive(socket: WebSocket) -> Any:
            received_data = await socket.receive_data(mode=listener._receive_mode)
            return received_data.encode("utf-8") if isinstance(received_data, str) else received_data
    else:
        async def handle_receive(socket: WebSocket) -> Any:
            received_data = await socket.receive_data(mode=listener._receive_mode)
            return decode_json(value=received_data, type_decoders=socket.route_handler.resolve_type_decoders())
    return handle_receive