Search code examples
c#.netwcfremotingclient-server

Simple client / server concept for .NET


I want to implement a simple cardgame in silverlight that can be played together via a server.

My question is, what concept for communication between client and server I should use.

  • Is it possible to use WCF to implement the server ? I guess no because its more like a dataprovider right ?
  • or do I need to use .NET Remoting ? Haven't read much about it yet, but I'm not quite sure if it is maybe out of date ?
  • Maybe there are newer approaches that I don't know yet ?

Maybe someone has a good tutorial link for the beginning that is not a bad coded sample from year 2002


Solution

  • WCF and .NET Remoting define communication protocols, that is, they define the plumbing between client and server.

    When writing a client/server application, you should use WCF as .NET Remoting is deprecated.

    See this code project article and code for a simple client/server implementation using WCF. The code is for uni-directional communication, where the server responds to the client.

    Here is another article, with a more complicated sample (chat client), using bi-directional communications between client(s) and server. It also uses WPF as the UI layer, so you may need to read around that if using winforms.