writing a simple networking game

  • Thread starter Thread starter Bern
  • Start date Start date
B

Bern

This is the first time I'm writing a network multiplayer card game.
And the model I have thought of :

The host creates a new thread and this thread listens for clients.

When a client is requesting for connection, the host creates another thread
to communicate with the client throughout the game.

Thus, the whole program has (n + 2) threads, for n clients.
(one for listening, and another one for the GUI)


The client only have to create one thread to communicate with the host.

So is there any built in classes that may be of any help beside the Socket
class.

Is there any other better models?
 
You could use remoting which will handle all of the threading for you via the CLR thread pool

Regards

Richard Blewett - DevelopMentor
http://www.dotnetconsult.co.uk/weblog
http://www.dotnetconsult.co.uk

nntp://news.microsoft.com/microsoft.public.dotnet.languages.csharp/<[email protected]>

This is the first time I'm writing a network multiplayer card game.
And the model I have thought of :

The host creates a new thread and this thread listens for clients.

When a client is requesting for connection, the host creates another thread
to communicate with the client throughout the game.

Thus, the whole program has (n + 2) threads, for n clients.
(one for listening, and another one for the GUI)


The client only have to create one thread to communicate with the host.

So is there any built in classes that may be of any help beside the Socket
class.

Is there any other better models?
 
I'm pretty sure you are going about this the correct way. The only thing left is
to
properly define your game engine to make the input process *easy*. I have a
number
of postings on this and did a web-cast back in July... You should be able to
access
the information by scanning through my blog, but here is a specific category
that
holds most of my card engine postings and considerations.

http://weblogs.asp.net/justin_rogers/category/7611.aspx
 
Hi Bern,

I'd like to know if this issue has been resolved yet. Is there anything
that I can help. I'm still monitoring on it. If you have any questions,
please feel free to post them in the community.

Kevin Yu
=======
"This posting is provided "AS IS" with no warranties, and confers no
rights."
 
Back
Top