Message not sent from server / received by client due to data size?

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

Moderators: Lapo, Bax

Post Reply
yqtang
Posts: 13
Joined: 03 May 2022, 19:14

Message not sent from server / received by client due to data size?

Post by yqtang »

Hi Lapo,

I had some issues sending / receiving messages from server to client. We debugged the execution path and we are affirmative that "SFSExtension.send" did get executed since its later trace got printed on log. But the message is never received by the Client. This issue can be random and with our experiments, seems like if you try to send a message with larger data size, it won't get through to the client. We tried to break one message into several smaller pieces and it seemed to work. It will also be more difficult to have the message to get through if the room has been taken up more memory (for example, more people in room, more data saved in room). But regardless, when it happens, there is never any error or exception about this. I believe it's about the message size because I have many other messages sending / receiving smoothly with no problems. It happens only on this one message that contains the state of the room. Our experiment is not huge with only two people in room, with several objects(5 - 6) data. We do use SFSArray inside the message.

Could you possibly think of any factors that would affect message sending / receiving? How would I check on them? What potential solutions could I have? I am running SmartFox on a ec2 VM. It has 2 CPUs, 2GB memory. Thank you very much for any help in advance!
User avatar
Lapo
Site Admin
Posts: 23438
Joined: 21 Mar 2005, 09:50
Location: Italy

Re: Message not sent from server / received by client due to data size?

Post by Lapo »

Hi,
it would help to see an example of a message that doesn't go through. If you can identify one it would also help to try and reproduce the issue.

In any case here are a couple of thoughts:
1- unless you're sending data via UDP (which requires a specific flag in the send() method) all packets are sent using TCP so they should not be lost
2- a possibility of packet loss still exists if the other side (client) is too slow at processing the data and lags behind.

To find out if this is a case of packet loss check the SFS2X AdminTool > Dashboard. In the stats panel (bottom right side) you have a "Dropped packet" counter. See what is says.

You also mentioned big packets that you have tried to slice in smaller pieces. Typically you don't need to do that, unless you're using very large arrays. SFSObjects supports arrays of 16 bit (size), which means they can handle up to 32767 elements.
You can check those limitations here:
http://docs2x.smartfoxserver.com/Develo ... t-sfsarray

Hope it helps
Lapo
--
gotoAndPlay()
...addicted to flash games
Post Reply