服务器和客户端应用程序之间的推送通知机制 [英] Push Notification mechanism between a server and a client app

查看:26
本文介绍了服务器和客户端应用程序之间的推送通知机制的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用 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/上下载一个相当不错的实现获取下载/2032

您会在此处找到一篇好文章.

And you will find a good article here.

问候

这篇关于服务器和客户端应用程序之间的推送通知机制的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆