Cant send ByteArray

Post here your questions about SFS2X. Here we discuss all server-side matters. For client API questions see the dedicated forums.

Moderators: Lapo, Bax

Posts: 2
Joined: 12 Feb 2018, 13:13

Cant send ByteArray

Postby djungalio » 12 Feb 2018, 13:22


I have a problem with sending ByteArray to the server.

this is the code i use to get the byte[] in c#:

byte[] bytesArray = File.ReadAllBytes(<path>);
objOut = new SFSObject();
objOut.PutByteArray("anchorFile", new ByteArray(array));
sfs.Send(new ExtensionRequest("addNewRoomAnchor", objOut));

If the array is big the message wont send. So i tried other thing. The server sends me the same file bytes and when i receive them on the client i apply the code above and it works.

Any suggestions. Thank you in advance!

User avatar
Site Admin
Posts: 20577
Joined: 21 Mar 2005, 09:50
Location: Italy

Re: Cant send ByteArray

Postby Lapo » 12 Feb 2018, 17:29

How big is the array you're sending?
There's a limit on the size of the message that a client can send to the server. By default it is set to 500K (compressed).

If you need to send bigger data you can change the limit under SFS2X/config/core.xml

Hope it helps
...addicted to flash games
Posts: 2
Joined: 12 Feb 2018, 13:13

Re: Cant send ByteArray

Postby djungalio » 13 Feb 2018, 15:21

Thank you! I changed the size and it is working now!

Return to “SFS2X Questions”

Who is online

Users browsing this forum: No registered users and 8 guests