tags:

views:

181

answers:

5

Hi,

I'd like to write a program where you can have 2 clients that talk to each other in realtime. I've been looking into WCF services and Duplex messaging, data contracts etc but now I'm confused.

Basically I see it as:

[Client] --- msg --> [Server] --- msg --> [Client] and vica versa.

The server will just act as the messenger.

Could you please point me in the right direction? I'd like to use WPF for the client apps.

+3  A: 

Check out the WCF peer-to-peer programming paradigm. It will be extended in WCF 4 (with .NET 4 - due out April 12, 2010) by allowing dynamic discovery (and article here) of other clients on your network.

marc_s
Thanks. I had a look at the dynamic discovery and ran the solution in VS. I'm still stuck.It feels like there's a handful of different ways of doing it.
A: 

Perhaps Windows Azure Service Bus (which uses WCF) might be worth a look?

Service bus can effectively be used as a message bus, which is one way to implement what you are describing.

Schneider
Sledgehammer to crack a nut?
Winston Smith
Not necessarily. I believe you can use it locally, and samples ive seen are not much more complex than straight wcf
Schneider
+2  A: 

This should help get you going: WCF / WPF Chat Application

Eric Dahlvang
A: 

I can think of two scenarios

  1. The clients are the only ones that start a request, to send they push messages and to receive they request periodically for new messages. The main advantage of this architecture is that it is more firewall-proof.

  2. The clients are also servers that receive messages relayed by the central server. The main advantage is that the clients receive updates faster and they save bandwidth.

Jader Dias
I'm interested in option 2 but am unsure of what to look at with WPF/WCF
A: 

Hi

I wrote program like your sample!!! but it has one big different: My program have a chat server and a client. clients can chat to others.(with chat server service)

This program use two wcf service for make a connection between client and server.(client call server and send message for it,server get message from client and send for all client have connected to server)I think u used one service and must be use two service(like me) or use Duplex Service.

The sucha barber`s example is too cool(WCF/WPF Chat Application in answer eric). He used duplex services but real problem of this example is "sucah used WPF too and it s expert example for beginners (like me and u)".

If u want i can share my program!!!

seethis

Rev