Will invalidating interface causes UDP packets disposed?

Y

ygy

When I receive the UDP packets,and then Set the image pixel using
Image::Setpixel(),but When I invalidate the interface to show the image,the
UDP packets missed.How to solve the problem?
thank you in advance!
 
S

ShaneB

If you intend on using UDP and you don't want to drop any data, you have do
all the packet tracking yourself. I've done this before and it's not too
difficult. Essentially, you add a header to each packet which gives it a
sequential number and the total data length that is being sent. On the
receiving end, you reassemble the received packets and see what's missing.
Knowing that the packets are numbered sequentially, you can figure out which
packets are missing and ask the server to resend them.

Remember, UDP means that the packets may come in any order...and some or all
of them could be dropped anywhere along the way. With UDP, packetloss is
expected and must be considered. As you can see, UDP is not the preferred
method for lossless data transfers.

The real question is, do you have to use UDP to transfer the image? Using
TCP would make this much easier since it does most of the work for you.

ShaneB
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top