客户端(桌面应用程序)中提取数据...但我希望服务器(Web应用程序),将数据推 [英] The client (desktop app) pulls data...but I want the server (web app) to push data

查看:99
本文介绍了客户端(桌面应用程序)中提取数据...但我希望服务器(Web应用程序),将数据推的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个客户端 - 服务器应用程序 - 其中服务器本质上是一个ASP .NET Web应用程序和分布式客户端桌面应用程序

I have a client-server application - wherein the server is essentially an ASP .NET web application and the distributed clients are desktop applications.

客户机需要从服务器接收的一些数据 - 当有客户端的新数据。眼下,这样做的方式是 - 客户端保持查询的Web服务每隔x分钟(如2分钟),并不断检查,如果有客户端的新数据。

The clients need to receive some data from the server - when there is new data for the client. Right now, the way this is done is - the client keeps querying a web service every x minutes (say 2 minutes) and keeps checking if there's new data for the client.

在理想情况下,它应该工作的方式是桌面应用程序应该得到更新,因为当他们是否有空,它不需要从服务器上拉;而不是服务器应该能够推到客户端。

Ideally, the way it should work is that the desktop app should receive updates as and when they are available, it need not pull from the server; instead the server should be able to push to the client.

我如何去这样做 - 定的解决方案的架构 - 一个Web应用程序需要在同一网络(局域网)的数据推送到桌面应用程序(客户端)

How do I go about doing this - given the architecture of the solution - a web application needs to push data to desktop applications (clients) in the same network (a LAN)?

推荐答案

什么你所描述的是服务器推送,它这些天通常被称为彗星。在网络搜索使用这些关键字应该打开了很多有用的信息。

What you're describing is "server push", which these days is often called "COMET". Using those keywords in a web search should turn up a lot of useful information.

造成这种情况的最常见的技术被称为挂GE​​T。客户端发送一个GET请求到一个特定的URL,服务器接受连接,但延迟发送一个响应,直到它有数据要发送。当客户端收到响应它发送另一个GET所以它是准备另一条消息。

The most common technique for this is called a "hanging GET". The client sends a GET request to a specific URL, and the server accepts the connection but delays sending a response until it has data to send. When the client receives the response it sends another GET so it's ready for another message.

这篇关于客户端(桌面应用程序)中提取数据...但我希望服务器(Web应用程序),将数据推的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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