WCF Duplex Service with Inter-Session communication
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 sessio开发者_如何学Pythonns. What's the best way to do this?
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.
精彩评论