Hello everyone.

The Mixed Reality Forums here are no longer being used or maintained.

There are a few other places we would like to direct you to for support, both from Microsoft and from the community.

The first way we want to connect with you is our mixed reality developer program, which you can sign up for at https://aka.ms/IWantMR.

For technical questions, please use Stack Overflow, and tag your questions using either hololens or windows-mixed-reality.

If you want to join in discussions, please do so in the HoloDevelopers Slack, which you can join by going to https://aka.ms/holodevelopers, or in our Microsoft Tech Communities forums at https://techcommunity.microsoft.com/t5/mixed-reality/ct-p/MicrosoftMixedReality.

And always feel free to hit us up on Twitter @MxdRealityDev.

WorldAnchorTansferBatch

chanmobchanmob
edited February 2018 in Questions And Answers

i tested with a single hololens and a computer
how do I fix an indexout error when I try to debug a computer(client) when hololens(server) send an array byte in the process of exporting?

    public void ExportWorldAnchor()
    {
        transferBatch = new WorldAnchorTransferBatch();
        transferBatch.AddWorldAnchor(gameObject.name, worldAnchor);
        WorldAnchorTransferBatch.ExportAsync(transferBatch, OnExportDataAvailable, OnExportComplete);
    }

    private void OnExportComplete(SerializationCompletionReason completionReason)
    {
        if (completionReason != SerializationCompletionReason.Succeeded)
        {
            Debug.Log("Fail");
        }

        else
        {
            Debug.Log("Success");
        }
    }

    private void OnExportDataAvailable(byte[] data)
    {
        NetworkContent nc = GameObject.Find("NetworkContent").GetComponent<NetworkContent>();
        nc.TransferByteToClinet(data);
    }

----------------- NetworkContent -------------------------

    public void TransferByteToClinet(byte[] data)
    {
        if (!isServer)
            CmdTransferByteToClient(data);
        else
            RpcTransferByteToClient(data);
    }

    [Command]
    public void CmdTransferByteToClient(byte[] data)
    {
        RpcTransferByteToClient(data);
    }

    [ClientRpc]
    public void RpcTransferByteToClient(byte[] data)
    {
        foreach(var d in data)
        {
            Debug.Log(d);
        }
    }
Tagged:

Answers

  • Hey, @chanmob

    I believe the size of the byte array arriving in OnExportDataAvailable is bigger than that allowed by the RPC call. We are talking megabytes sometimes. You have to split it more finely.

    Hope this helps.

    Building the future of holographic navigation. We're hiring.

Sign In or Register to comment.