Network play

Post: #16
Indeed, flexibility is the word here. For the high-end games, there's nothing wrong with just going for UDP (IMHO).

TCP is a stream indeed, so you'll need a way to distinguish packets. Although that's a matter of a single integer (16-bit perhaps), in this world of bandwidth limitations that is a first sign to look for a better approach.

Lost reliable packets can also be piggybacked on regular, non-reliable packets through UDP, giving a chance for improved bandwidth. It all adds up in small quantities (to choose for UDP instead of a mixed UDP/TCP). If only the increased complexity of your network layer.

TCP btw has a TCP_NODELAY flag to have every write() being sent immediately.

I don't know, for a game you CAN do better than TCP, as TCP wasn't targeted at speed and bandwidth as much, but reliability. It just takes time, but then again, that's what bleeding edge programming is for.
Quote this message in a reply
Post Reply 

Possibly Related Threads...
Thread: Author Replies: Views: Last Post
  java network api San_Andreas 1 4,263 May 1, 2008 08:05 AM
Last Post: AndyKorth
  Getting network connection for a specified PID Florian 6 7,094 Dec 23, 2006 03:46 AM
Last Post: Florian
  Ways to Network. BinarySpike 28 19,524 May 10, 2005 07:44 PM
Last Post: kodex
  Network Code Design Bachus 5 6,071 Sep 26, 2004 06:54 PM
Last Post: arcnon
  Network Servers - whose connected to me? Zenith 3 6,459 Oct 2, 2003 04:29 PM
Last Post: Steven