views:

68

answers:

2

Hey everyone

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

+2  A: 

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.

Oded
I read this example before I posted here. But this example doesn't show the possibility that the server may post data on its own to the clients without a request ?! That's what I want to do somehow because I don't want to implement a client that needs to request data every few seconds. Is this possible ?
KroaX
@KroaX - Answer updated, added a link to a bi-directional example.
Oded
@Oded - Thank you very much! Exactly what I searched for and because I will use Silverlight, WPF perfectly fits.Thanks again !
KroaX
+1  A: 

WCF (Windows Communication Foundation) is the .NET technology for communication. It includes simple client / server scenarios, as well as publish / subscribe and peer to peer.

Ignore .NET Remoting. It has been replaced by WCF.

I have no idea why you thought that WCF was a data provider, but you're mistaken. See the WCF Developers Center for more on WCF.

John Saunders
I thought WCF is a data provider because I only used this one as a service so far. But as you said I am mistaken I guess
KroaX