The maximal transferable data size with one packet is 65507 Bytes.
How big the udp - packets exchanged between 2 boxes are effectively allowed to be , is controlled by the sysctl vars
net.inet.udp.sendspace on sender"s side
and
net.inet.udp.recvspace on receiver"s side.
sendto( nbytes ) will fail with "Inappropriate message buffer length" (EMSGSIZE), if <nbytes> is greater then <net.inet.udp.sendspace>
Sender"s <net.inet.udp.sendspace> should be smaler/equal
(best would be exactly) <net.inet.udp.recvspace> - 16
of the Receiver
Pakets with data volume more than <net.inet.udp.recvspace> - 16
Bytes will be dropped without comment from the udp stack.
recvfrom( nbytes ) blocks, until a paket was accessed/taken from the stack .
recvfrom( nbytes) gives the number of the overtaken/absorbed data bytes in the accessed packet.
That means the result can _never_ be bigger than <nbytes>
Too short packets can be detected directly.
To be able to detect too long packets effectively you would have to execute recvfrom( expected_nbytes + 1 ); Cause longer packets (as mentioned above) are either dropped without comment (if they are longer than <net.inet.udp.recvspace> - 16 Bytes) or will be truncated/clipped during receiving on maximal (<expected_nbytes> + 1) Bytes. So the detection of those manifests in having received that max number of bytes.
NOTE:
This entry has been validated against the SDP version listed above. Use
caution when considering this advice for any other SDP version. For
supported releases, please reach out toQNX Technical Support if you have any questions/concerns.
Please contact us with your questions or concerns.
BlackBerry uses cookies to help make our website better. Some of the cookies are necessary for the proper functioning of the website while others, non-essential cookies, are used to better understand how you interact with our website and to make it better.