推服务器和客户端应用程序之间的通知机制

问题描述:

我的深化发展使用C#,其中有超过一个WCF Web服务的服务器进行通信的桌面应用程序。它应该是一种同步的应用。这意味着,当我在做客户端应用程序的一些变化,我应该也立即更新服务器(这是很容易使用服务调用),也该机制应提供反之亦然,在服务器上的改变必须立即在多个客户端应用。我知道我可以投票给我的服务器,但是这并不显得利落给我,我也听说过双工服务,但我不知道如果我可以用它来实现这种机制。

I am developping a desktop application using C#, which communicates with a server over a WCF Web Service. It is supposed to be a kind of synchronization application. Meaning that when I make some changes on client app I should immediately update the server too(this is easy using service calls), but also this mechanism should be provided vice versa, a change on server must immediately be applied on several clients. I know I can make polling to my server but this doesn't look neat to me, and also I've heard of duplex services, but I'm not sure if I can use it to implement this mechanism.

我要求在这个问题上提出了一些建议。先谢谢了。

I am asking for some suggestions over this issue. Thanks in advance.

您需要实现发布和订阅设计。在WCF,你可以用net-TCP协议在双工客户端和服务器连接

You need to implement a publish and subscribe design. In WCF you could use net-tcp protocol to connect in duplex clients and server.

您可以下载一个相当不错的实现上的 http://www.idesign.net/Downloads/GetDownload/2032

You could download a quite good implementation on http://www.idesign.net/Downloads/GetDownload/2032

和你会发现一篇好文章这里

And you will find a good article here.

问候