Archived

This topic is now archived and is closed to further replies.

logout

udp recving

Recommended Posts

Usually you will receive your entire packet. You can receive an error, EMSGSIZE (WSAEMSGSIZE), when calling recvfrom(). This indicates that the datagram was too big to fit in your supplied buffer. Depending upon your OS, you will either receive a partial packet up to your buffer size or no packet at all.

Share this post


Link to post
Share on other sites
quote:
Are it sure that all the data got sendt/recvived ?


IF you receive a packet, you are guaranteed that you got the whole thing (or EMSGSIZE as stated - which is typically caused by a programmer error, so it''s not really a protocol issue). Key word here is IF.

quote:

Or do i have to do the same as i have to do with TCP ?


Only if you are fragmenting large messages on your own (not uncommon, and quite necessary if you are coding a reliable protocol on top of UDP). Then on the recvfrom you would basically want to reassemble the fragments as they arrive.

Share this post


Link to post
Share on other sites