与多个客户端一起使用WCF [英] Uingg WCF with multiple clients
问题描述
大家好,
我正在尝试使用WCF来实现客户端/服务器模型.我已经说过了,WPF客户端向服务发送请求以增加一个数字,然后同一台计算机上的另一个客户端再次增加该数字,并且它们都依次增加了数字,从而得到正确的结果.
我想知道如何做到这一点,以便使所有客户端都可以在运行时看到数字递增而不必单击递增按钮来查看新的更新值;
任何教程/文章将不胜感激.
关于
Hi All,
I am trying to use WCF to implement a client/server model. I have gotten to a point that a WPF client sends a request to the service to increment an number and then a second client off the same machine increments the number again and they both increment the number in turn with corrrect results.
I was wondering how I could do it so that voth clients willl see the number being incremented at runtime without having to click the increment button to see the new updated value;
Any tutorial/articles would be greatly appreciated.
Regards
推荐答案
您想要一个WCF引发且WPF客户订阅
的事件
http://msdn.microsoft.com/en-us/magazine/cc163537.aspx [ ^ ]
每当WCF服务增加编号时,您都想引发该事件并将新信息传递回订阅者.
You''d want an event that your WCF raises and your WPF clients subscribe to
http://msdn.microsoft.com/en-us/magazine/cc163537.aspx[^]
Whenever your WCF service increments the number, you''d want to raise the event and pass the new information back to subscribers.
这篇关于与多个客户端一起使用WCF的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!