If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register or Login
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.

How do I know I have the full packet from a UDP message?

This is my first time working with a network!!!! I'm super excited and thank you for taking time to help me out. I thought you could use the recv function to look at parts of a udp message. I have someone sending me a message that could be up to 50000 bytes and in the header of that message he tells me how big the packet is. So I thought I could use recv to receive only the header first, then I could see how big the packet is and I would know when I have to full packet, but this method gave me 10040 socket error messages. So I'm just going to use a buffer that's 50000 bytes and receive the whole packet at once. My question is how will I know I have the full packet?