Information about message size
Options
Comments
-
Hi @benjaml.
There is no 1200bit limit and I am not aware of any place in the documentation where it states that there would be such a limit.Client::sendDirect()
has a message size limit of 1200 bytes (NOT bits!).Client::opRaiseEvent()
in UDP mode splits messages up into multiple fragments that are sent in separate UDP datagrams, if the overall message size including protocol overhead exceeds 1200 bytes. Note, that althoughopRaiseEvent()
supports messages bigger than 1200 bytes through fragmentation that does not mean that there is no limit at all. Please see the link by @JohnTube for details. Please also note that when a message gets fragmented, the reliability-flag will be ignored and the fragments of that message will always be sent reliably. The reason for this is, that if only a single fragment gets lost all other fragments of that message become useless.
Why 1200 bytes?
Because UDP is affected by the https://en.wikipedia.org/wiki/Maximum_transmission_unit that can vary at every point in the internet infrastructure that a datagram passes on its way from the sender to the receiver (TCP automatically deals with this under the hood similarily to how our UDP message fragmentation deals with it). 1200 bytes from our experience is a pretty save bet. If we would allow datagrams of a considerably bigger size, then lots of messages would get lost on their way, because they would need to pass hardware that can't process datagrams that big.
As stated in the API reference forClient::sendDirect()
, it does not support fragmentation and for messages that need this feature you should useopRaiseEvent()
instead.
If you want to send bigger messages withsendDirect()
or if you want to send them unreliably withopRaiseEvent()
, you can of course always split them up into smaller chunks and rebuild them on the receiving side yourself.1