extreme ping with tcp over inet

Started by
9 comments, last by Dreddnafious Maelstrom 19 years, 7 months ago
Quote:Original post by Anonymous Poster
The trick to making TCP run smoothly is treating it like the streaming protocol that it is.

a) buffer all outgoing messages and only send the buffered data once per interation of your main loop. This cuts down immensly on overhead.

b) Your main loop should be running hundreds if not thousands of iterations per second even if you are rendering graphics at a lower FPS. Do not force a frame render every iteration. Allow for frames to be dropped and maybe even cap the rendered frame rate to free up time to handle network data. You cannot avoid software induced lag, you can only try to minimize it.

c) buffer all incomming messages and break them apart in software when you're actually looking to handle the individual messages. do not try to break apart messages as the data comes in. It's a big giant waste of time.

see

http://www.icarusindie.com/DoItYourSelf/LifeOnLine/

The client contains these concepts implemented in a plug and play winsock class. You just need to supply the server end of it using the same concepts.

TCP can be very fast. You just have to implement it properly to reduce network lag and write tight efficient code to minimize software induced lag.



Hi Ben :)
"Let Us Now Try Liberty"-- Frederick Bastiat

This topic is closed to new replies.

Advertisement