Maximum byte size for message

Apologies for spamming the forums.

What is the absolute maximum byte size for each message? (does broadcast to null count as a single message or x number of messages based on how many presences there are?)

I am thinking of sending initial sync data as one massive message (upwards of 4kb as it contains the information of 50+ players) - is there any pros or cons to sending this large a file as one message?

I saw a separate post by @gruset where they encountered an error (?) when attempting to send a larger file so I just wanted to clarify ahead of time.

Thanks a lot!

Hi @Zeroxidic,

The maximum size is configurable but defaults to 4096 bytes as seen in our configuration documentation.

Where possible I would recommend sending smaller messages, but if it is a one off or infrequent thing there shouldn’t be an issue.

This is great news! The game is turn based giving players time to make decisions within a time frame. after the time frame, the decisions are sent to the server and broadcast to everyone - the data and results are processed by the clients

so ~2kB updates every 2 minutes is more or less what is happening with ~100B tick/state updates every second.

Thank you!

Understood, yes this shouldn’t be a problem.

A note on that. The linked parameter states “Maximum amount of data in bytes allowed to be read from the client socket per message. Used for real-time connections. Default value is 4096.”

so i read this as being just for incoming messages. Which i would confirm: I do broadcast state that has been grown over 20kb. which worked fine, even though i have the config on default 4096.