Skip to main content
gamedev.net
🔒 Locked

Basic question on game loop and networking

Started by leiavoia 0 replies 500+ views
Original Post
leiavoia
leiavoia
basically, where should the networking aspects of my game project (checking for incoming data, handling that data) fit in: in the game loop or in a seperate thread? I ask because it''s so hard to find simple examples of this sort of thing and i''ve never done it before. I''ll be using SDL_net and i''m already pretty well invested in ParaGUI (based on SDL). ParaGUI keeps tabs on it''s own gameloop for processing events and running the GUI. putting extra code into would be especialy difficult (means having to recompile paragui). Creating the networking functions inside a different thread would work, but i''ve never programmed a thread in my life and i''m concerned about compatability issues betwen linux and windows (and possibly MacOS as well) Any quick answers or pointers (preferably to examples or tutorials) ? thanks all
JY
JY
Pop it in the game loop - worked for Doom and Quake etc.

Just remember to use non-blocking sockets



"Absorb what is useful, reject what is useless, and add what is specifically your own." - Lee Jun Fan
"Absorb what is useful, reject what is useless, and add what is specifically your own." - Lee Jun Fan

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.