Quote Originally Posted by arthurprs
opz, sorry my english.

let me try again,

what happens if the size of the record (that will be send after its size) is lost?

ps: im saying this cuz i read somewhere that UDP can lose some data
It's not common that udp looses some random bits in the packet, either the packet is lost or not.

To avoid some nasty crashes with lost packets make shure that you keep the data amount in each packet to less then the UDP framesize (sadly it varies depending on the network type), then you wont have to wory about getting to little data.

If you want to send larger packets you have to code around this, make shure the length of the incomming data is larger then the length of the stream. If it's not you have to append the next packet that arrives to the stream.

What you probably going to need then is some kind of sequencing so you can detect when the 2nd packet is lost, else you will get incorrect data for the next packet.

Writing theese algoritms is big task, i would recommend using something like ENet where theese things are already written