I'm trying to implement a WCF service with duplex messaging for a multi-user status messaging system... What I can't really figure out how to do though (I'm very new to WCF) is communicate across sessions within the WCF service instance. So, for example, a new message comes in... I want to log that to a database so I can pull up a history later, but then broadcast that message back to all connected sessions. What's the best way to do this?
Asked
Active
Viewed 751 times
1 Answers
1
A List-Based Publish-Subscribe model would be suitable for your use case, for which there is a good article on MSDN on how to implement this in WCF using duplex communication: http://msdn.microsoft.com/en-us/library/ms752254.aspx
This uses the regular .NET events mechanism to push the updates to all subscribers.

Pero P.
- 25,813
- 9
- 61
- 85
-
This article explains it well. You basically need to keep track of your callback channels so you can pass messages back to the clients. In my own implementation I maintain a List
so I can target all or specific clients. – Matt Roberts Jul 06 '11 at 20:11