At 10:21 PM -0500 9/30/03, Hugh Bayer wrote:
Since using multicast is out for internet communication, and a many-person
chat situation is going to involve a server/client setup, what are the
reasons for using UDP over TCP/IP, or vice-versa?
You use UDP when speed matters and you don't need guaranteed packet
delivery. It's faster, *because* it doesn't guarantee that packets
will arrive in any particular order and some packets may not arrive
at all. That's fine for an action game, where the packets are
game-state updates; if you get one that represents a state older than
what you've already gotten, you just ignore it, and if you miss some
here or there it's no big deal.
You use TCP/IP when speed isn't so critical, or when you can't afford
to have any packets go missing or arrive out of order. A good
example would be a MUD-style game, where your commands need to be
received by the server no matter what, and similarly, the server's
responses need to be received by you (and in the order in which they
were sent).
Cheers,
- Joe
--
,------------------------------------------------------------------.
| Joseph J. Strout REAL Software, Inc. |
| joe at realsoftware dot com http://www.realsoftware.com |
`------------------------------------------------------------------'
- - -
Unsubscribe or switch delivery mode:
<http://support.realsoftware.com/listmanager/>
Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>
|