views:

329

answers:

6

Greetings readers! So I am trying to develop a client server system.. Since I have not designed a client server system before, I thought that I would post a question and see what the experts here have to say.

Requirements: .NET 3.5 WCF minimum of 2 computers, Master and Slave.

The use case is a testing environment, where the slave runs tests at the request of the master.

Questions: I would prefer that the slaves locate and connect to the master, and then the master takes control and is the one that initiates the tests to be run. The slave also makes progress reports: new test data, unexpected events, etc.

The part that I am confused about is that if the slave initiates contact with the master, doesn't that make him the master?

Does this mean that I need servicehosts on both slave and master so that they can initiate activity?

A: 

Client/server and master/slave are not to be confused. The Master controls actions, but the Server listens for connections.

If your Clients (slaves) are initiating all contact, all you need on the Master is something listening for these requests (webservice, etc) and a processing system.

tsilb
A: 

I don't know why your question is getting down-voted, it seems okay to me :)

If I were you I might be inclined to use netMsmqBinding (I love queues!). The master could dispatch requests to the slave by putting messages on an MSMQ queue, and the slave could send status reports back to the master via MSMQ. This way the two processes can work independently, and you won't have to worry about one keeping up with the other (unless one gets totally bogged down.)

To do this, you will need a ServiceHost in both processes. The master needs to host a netMsmq service, and the slave as well. Each will also need a client binding to send messages.

This would also allow you to scale out the number of slaves (or masters) in case you want more parallel processing. (All slaves can just pull messages off the same queue).

Just a thought.

Andy White
A: 

Read this for better understanding of available architecture options.

Augusto Radtke
+3  A: 

I decided to answer this question in a blog post:

http://dotmad.net/blog/2009/02/the-role-ofclients-and-services-in-wcf

dotmad
I'm flattered that my confused state was enough to write a blog post about. Your explanation is clear and instructive. It might be helpful to post it here, so that the text is searchable and available to the stackoverflow community.
MedicineMan
A: 

Check out DuplexContracts which should allow you to know methods that you can call upon your clients. There is also Event Handling in WCF, though it requires a bit more work than normal .NET eventing.

I haven't checked this page in a while, after a few down votes, I figured the question would never be answered. I simplified the responsibilities, and may implement a duplex contract similar to what you mention here.
MedicineMan
Glad I could help. I am currently working on a project using a DuplexContract myself.
A: 

I have posted SEVERAL questions in relation to this topic (for similar reasons it sounds like too) please search through my question history and maybe you'll find some good answers.

Firoso