On September 06 2010 11:00 gondolin wrote:
To be fair I never wrote huge multiplayer project using udp, so I may be wrong about this, but in my experience udp packets eventually do arrive (except when there are some problem with the MTU and thus but it will be detected at the IP level anyway).
To be fair I never wrote huge multiplayer project using udp, so I may be wrong about this, but in my experience udp packets eventually do arrive (except when there are some problem with the MTU and thus but it will be detected at the IP level anyway).
UDP packets are not guaranteed to arrive - that's exactly why it's "faster" than TCP: there's no confirmation of packet arrival sent back to the sender. TCP will keep sending the packet until it receives confirmation of it's arrival, while UDP just sends once and assumes it got there. It's possible, and indeed likely, that some UDP packets will never arrive. Any sort of guaranteed delivery in UDP would have to be manually coded into the software (or use some sort of library that handles that for you).
Really the protocol used isn't the issue. The actual amount of *latency* between the two protocols is the roughly the same as long as you're not dropping too many packets, it's just that TCP just requires slightly more bandwidth and has more overhead (as does UDP if you're using the aforementioned libraries to ensure delivery).
This page has a fairly good analysis of the two protocols: http://www.devmaster.net/wiki/UDP_vs_TCP