Sign in to follow this  
nixon

My first online Managed DirectX game

Recommended Posts

Hello, I'm making my first turn-based game in C#. Im using the lidgren network library: http://code.google.com/p/lidgren-library-network/ Im a little puzzled about what's the best way to process incoming network messages. My idea is to let 2 threads handle the network (one for listening - one for sending messages) and make a thread pool that I use to process each network message or request that I get. There is a question how big this thread pool should be and if I need some kind of locking mechanism (mutex) to allow only one thread at a time to be allowed access my game's ruleset. Would you recommend doing this any differently?

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
Can anybody please help me!!

I would be very thankful :)

Share this post


Link to post
Share on other sites
I've been thinking.

Isn't it better for the server to put incoming requests in a queue? (instead of using multiple threads)?

Share this post


Link to post
Share on other sites
I would recommend against threading and just use an application loop, polling messages and handling them as they arrive. Also; posting in the network or .net forum would probably give more answers.

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