Sign in to follow this  
huf

network card game

Recommended Posts

im working on network card game and i wonder how to write server program that would be able to send and get info for every play-table at once with minimum delay. using c++ ; SDL,SDL_net ; visual studio 2008

Share this post


Link to post
Share on other sites
server and client are comunicating already
client will chose table and join it. each table must start and run the game seperatly (start/determine cards for each player/check for winner...) becouse games dont start at the same time and arent "timealigned".

so server program should get/give different informations to all tables at once.

Share this post


Link to post
Share on other sites
Three ways:
1) Fork a new process for each table, and tell the client how to connect to that process using some free port.
2) Fork a new thread for each table, and tell the client how to connect to that thread using some free port.
3) Keep all tables inside the main thread, and update them as a state machine. When a given client sends data, forward that data to the appropriate state machine.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this