Chat Room application
The Publisher Subscriber model can be easily and effectively implemented in .NET using events and delegates. But implementing the same over the network seems to be a bit more challenging.The code sample provided demonstrates a simple chat room and it shows you how to go about setting up a publisher-subscriber architecture (using events) using WCF.
Before you read any further, please understand that this will work only for STATEFUL clients like Winforms and NOT for STATELESS clients like a web page.
The client is a Winforms application and the Host is a Console application.
The following areas of the technology have been leveraged:
- Ability of WCF to maintain sessions.
- Duplex communication capability - WCF
- Events and Delegates - .NET 2.0
Obviously, you'll need .NET framework 3.0 or higher for the code sample to work.
Here's screenshot of the client