Unable to receive large amount of data through RPC
The whole answer can be found below.
Try Our
Documentation
Please check if you can find an answer in our extensive documentation on PUN.
Join Us
on Discord
Meet and talk to our staff and the entire Photon-Community via Discord.
Read More on
Stack Overflow
Find more information on Stack Overflow (for Circle members only).
Unable to receive large amount of data through RPC
KRishna
2018-12-17 05:39:36
facing error..
ArgumentOutOfRangeException: Non-negative number required.
Parameter name: count
at System.Buffer.BlockCopy (System.Array src, Int32 srcOffset, System.Array dst, Int32 dstOffset, Int32 count) [0x00000] in
at ExitGames.Client.Photon.StreamBuffer.Read (System.Byte[] buffer, Int32 offset, Int32 count) [0x00000] in
at ExitGames.Client.Photon.Protocol16.DeserializeString (ExitGames.Client.Photon.StreamBuffer din) [0x00000] in
at ExitGames.Client.Photon.Protocol16.Deserialize (ExitGames.Client.Photon.StreamBuffer din, Byte type) [0x00000] in
at ExitGames.Client.Photon.Protocol16.DeserializeParameterTable (ExitGames.Client.Photon.StreamBuffer stream) [0x00000] in
at ExitGames.Client.Photon.Protocol16.DeserializeOperationResponse (ExitGames.Client.Photon.StreamBuffer stream) [0x00000] in
at ExitGames.Client.Photon.PeerBase.DeserializeMessageAndCallback (System.Byte[] inBuf
Comments
Hi @KRishna,
Thank you for choosing Photon!
How large is the data you are trying to send?
Could you give us a sample/example?
You can read about Photon Serialization here to find out more about the limits.
ArgumentOutOfRangeException: Non-negative number required.
Parameter name: count
System.Buffer.BlockCopy (System.Array src, System.Int32 srcOffset, System.Array dst, System.Int32 dstOffset, System.Int32 count) (at
ExitGames.Client.Photon.StreamBuffer.Read (System.Byte[] buffer, System.Int32 offset, System.Int32 count) (at <5bac2b0d73684de1adac4ad02bdde90d>:0)
ExitGames.Client.Photon.Protocol16.DeserializeString (ExitGames.Client.Photon.StreamBuffer din) (at <5bac2b0d73684de1adac4ad02bdde90d>:0)
ExitGames.Client.Photon.Protocol16.Deserialize (ExitGames.Client.Photon.StreamBuffer din, System.Byte type) (at <5bac2b0d73684de1adac4ad02bdde90d>:0)
ExitGames.Client.Photon.Protocol16.DeserializeParameterTable (ExitGames.Client.Photon.StreamBuffer stream) (at <5bac2b0d73684de1adac4ad02bdde90d>:0)
ExitGames.Client.Photon.Protocol16.DeserializeOperationResponse (ExitGames.Client.Photon.StreamBuffer stream) (at <5bac2b0d73684de1adac4ad02bdde90d>:0)
ExitGames.Client.Photon.PeerBase.DeserializeMessageAndCallback (System.Byte[] inBuff) (at <5bac2b0d73684de1adac4ad02bdde90d>:0)
ExitGames.Client.Photon.TPeer.DispatchIncomingCommands () (at <5bac2b0d73684de1adac4ad02bdde90d>:0)
ExitGames.Client.Photon.PhotonPeer.DispatchIncomingCommands () (at <5bac2b0d73684de1adac4ad02bdde90d>:0)
PhotonHandler.Update () (at Assets/Plugins/Photon Unity Networking/Plugins/PhotonNetwork/PhotonHandler.cs:158)
Hi @TeamA,
Thank you for choosing Photon!
Photon cannot serialize strings with UTF8 byte size bigger than short.MaxValue (32767).
Read about "Photon Serialization".
You can read this FAQ entry: "Is There A Limit For Photon Strings?"
Also, possibly related since you seem to exchange large messages: "Can I Send A Huge Message Using Photon?".
It's preferable to download or upload such data using HTTP based web service other than Photon.
Back to top