kseen
kseen

Reputation: 397

WCF service management

For instance, I have a WCF service that serve clients. Sometimes I should send some commands to that service to get some results. For example, if it's necessary to ban some client I would send some command like "ban John Doe" and service will add user named "John Doe" to ban list. How can I implement that? Should I use named pipes or something like that? Probably I should manage service from machine where service is running. Service is hosted in standalone console application. Thanks in advance!

Upvotes: 0

Views: 530

Answers (2)

Merlyn Morgan-Graham
Merlyn Morgan-Graham

Reputation: 59131

Create multiple services that access the same datastore. One for clients, and one for administration.

Why?

See: http://en.wikipedia.org/wiki/Interface_segregation_principle

How?

Use a database, and connect to it from both services. Something with a small footprint like SqLite might work if you don't already have a DB.

Bindings:

Named pipes might be a good idea for your binding since they aren't network accessible. Here is a tutorial:

But check out this question before you make the leap:

If that seems too risky, you could use net-tcp instead:

Upvotes: 0

Rev
Rev

Reputation: 2275

It's possible with do this with Code just you Need to do these step`s:

  1. All Client Notify self on service(add property to all method as Name or Id)
  2. Keep all client name (after first-time) in Static-List as ClientList
  3. Write service method to remove ban Client From That List
  4. Write simple method to check that list and if client Doesn't exist in list, simply return none value for any Method

Upvotes: 1

Related Questions