0

Is it possible to fire event from service to connected clients without request from client? (I know, if I use client request I could use callback)

I store object in the service with some actual state. State of this object can change very often. First method: I can send request to this service every second, but I suppose they are better ways.

I thought about event called by wcfservice itself - possible?

Saint
  • 5,397
  • 22
  • 63
  • 107

1 Answers1

2

Well there are callback available in WCF, I guess that what you are asking for. http://msdn.microsoft.com/en-us/magazine/cc163537.aspx

Martin Moser
  • 6,219
  • 1
  • 27
  • 41
  • Isn't it CALL-BACK? And in this case there's no CALL – Saint Jun 26 '12 at 13:57
  • @Saint you might be taking the "callback" name a little too literally. As long as you keep a collection of subscribers (i.e. your clients) you can always make calls to them, even without them initiating the call. This is a way you'd tackle asynchronous services. You can force your clients to "initiate" a session ( http://www.remondo.net/managing-wcf-session-lifetime-isinitiating-isterminating/ ) that way you have a single method that you can use to keep add subscribers to a collection from. Then, whenever you want to broadcast, just iterate through that subscriber collection. – Thelonias Jun 26 '12 at 14:35