The Photon Forum
is Closed Permanently.

After many dedicated years of service, we have made the decision to retire our Forum and switch to read-only: we´ve saved the best to last! Your search result can be found below. Plus, we offer support via these channels:

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).

Write Us
an E-Mail

Feel free to send your question directly to our developers.

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 :0
at ExitGames.Client.Photon.StreamBuffer.Read (System.Byte[] buffer, Int32 offset, Int32 count) [0x00000] in :0
at ExitGames.Client.Photon.Protocol16.DeserializeString (ExitGames.Client.Photon.StreamBuffer din) [0x00000] in :0
at ExitGames.Client.Photon.Protocol16.Deserialize (ExitGames.Client.Photon.StreamBuffer din, Byte type) [0x00000] in :0
at ExitGames.Client.Photon.Protocol16.DeserializeParameterTable (ExitGames.Client.Photon.StreamBuffer stream) [0x00000] in :0
at ExitGames.Client.Photon.Protocol16.DeserializeOperationResponse (ExitGames.Client.Photon.StreamBuffer stream) [0x00000] in :0
at ExitGames.Client.Photon.PeerBase.DeserializeMessageAndCallback (System.Byte[] inBuf

Comments

JohnTube
2018-12-17 13:06:09

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.

TeamA
2019-10-16 09:14:10

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 :0)
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)

JohnTube
2019-10-16 09:46:44

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