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

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

Cant send ByteArray

Postby djungalio » 12 Feb 2018, 13:22

Hello.

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!

Regards,
G.G.
User avatar
Lapo
Site Admin
Posts: 20216
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
Lapo
--
gotoAndPlay()
...addicted to flash games
djungalio
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: Google [Bot] and 8 guests