3

my problem is that i am trying to write a program that sends data to clients via wcf.

i have read a lot about it and finally i saw this topic in code project: http://www.codeproject.com/Articles/34333/Topic-based-publish-subscribe-design-pattern-imp

i have implemented it so it will be good to my needs. the problems are:

  1. i have multiple clients and there is some messages that i need to notify only one client and not all of them.
  2. sometimes i want my client to receive a message from the server,do something and then reply another message to the server

thanks ahead for the help

  • 1
    You can use `Dictionary` to register all clients and store callback channels to them as values. Later you can get some of these values by using specific Key. And use channel to send some message or invoke action using RPC. – Fabjan Oct 21 '15 at 14:45
  • Never heard about it i will check it in google thx for the answer! – Roei Bouzaglo Oct 21 '15 at 16:01

1 Answers1

1
  1. Set an id for your clients. And then just include id (or id collection) into your messages, so clients can filter messages.
  2. I guess you can develop your client so it can be both publisher and subscriber? Not sure what is the problem here
athabaska
  • 455
  • 3
  • 22
  • Thx for the answer. The first answer is exectly what i need! I will re explain my 2nd question im trying to get from the client how much free memory it has in gb,the problem is that in that implementation the client can only subscribe and un subscribe to the publisher using the service – Roei Bouzaglo Oct 21 '15 at 15:55