UDP gurus? Trying to figure out total packet size.

BlitzMax Forums/BlitzMax Programming/UDP gurus? Trying to figure out total packet size.

The forum is locked. These are the original blitzbasic.com forums, kept so they can still be read. No new topics, replies or edits can be made here. To join in, head over to the Blitz3D+ forums.

UDP headers are 8 bytes.
UDP headers contain 4 fields:
1) source port number = 2 bytes
2) destination port number = 2 bytes
3) length of data portion = 2 bytes (Length: The length of the entire UDP datagram, including both header and Data fields.)
4) UDP checksum. = 2 bytes

the packet size = the 8 byte header + the size of your DATA.

keep in mind that as your packet snakes it's way across the internets, it may change size due to the transport mechanism being used.

It could get encapsulated into another packet or frame, etc but when the UDP packet gets to the destination, it will be the same size as it was at the source.

hope this helps.